Subject Re: [firebird-support] FB 2.1 Embedded hangs on exit
Author Richard Wesley
On 23 May 2008, at 20:45, Dmitry Yemanov wrote:

> This issue is resolved in the v2.1.1 release which should be
> released soon.


Great! Is it in the latest snapshot/beta?

And just to be sure, here are the comments from the developer who was
investigating this issue and the references. Could you have a quick
look to make sure we are all talking about the same things? Many thanks!

Commentary:

> I think this really is a firebird problem. ExitProcess() in
> windows forcibly shuts down all threads. The OS deals with
> synchronization objects specially in this state, but apparently
> firebird doesn’t.


> According to the article i listed below, WAIT_ABANDONED is what
> gets returned from WaitForMultipleObjects in this scenario.
> looking at isc_sync.cpp, the ISC_event_wait implementation for
> windows seems to ignore WAIT_ABANDONED return values, it shouldn’t.


> Also, the article recommends detecting the proccess shutdown case
> of DLL_PROCESS_DETACH and skipping usual cleanup. According to the
> docs, that happens this way:
>> lpvReserved
>>
>> [in] If fdwReason is DLL_PROCESS_ATTACH, lpvReserved is NULL for
>> dynamic loads and non-NULL for static loads.
>>
>> If fdwReason is DLL_PROCESS_DETACH, lpvReserved is NULL if DllMain
>> has been called by using FreeLibrary and non-NULL if DllMain has
>> been called during process termination.
>>
>>
>
> So, in the lpvReserved != NULL case, firebird should not shut
> things down, it should just get the hell out of dodge. No telling
> what state things are in.


References:

<http://blogs.msdn.com/oldnewthing/archive/2007/05/03/2383346.aspx>
< http://msdn.microsoft.com/en-us/library/ms682583(VS.85).aspx>


________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html