On Mon, 03 Nov 2008, Szak�ts Viktor wrote:

Hi Viktor,

> This code will consistently GPF (tried in 1.0.1 BCC 5.5,
> current 1.0.1dev with MSVC 2005, and a bit older 1.1.0dev with BCC 5.8)
> ---
> PROC Main()
>      USE nothere // This file should not exist, and a QUIT should be selected 
> in the RTE alert.
>      RETURN
> EXIT PROCEDURE App_Exit()
>      dbCloseAll()
>      RETURN
> ---

Exactly and it's an example of the problem I was talking about when
user code closes open WA when some other code still operates on it.
EXIT procedures in ST mode are executed just after QUIT in RT error
before control returns to RDD. It's Clipper compatible behavior.
In MT mode I change it to execute EXIT procedures after leaving all
functions by all threads so this code will not exploit the problem
but it does not fix it. Such situation can be created also in other
ways too, f.e. custom error handler can close WA on which someone
operates. To resolve it we will need similar mechanism to the one I
added to GT code and each time WA pointer is accessed then it should
be later freed. In GT it's done by hb_gt_Base()/hb_gt_BaseFree() and
it will force many modifications in existing RDD code.
We can also try to create some partial solution but it will only
reduce the problem.
The effect of the above code depends on memory context. After
dbCloseAll() the RDD code will operate on freed memory where
WA were located. It may cause GPF or not but of course it serious
bug.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to