You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the apllication exits and there are still connections open using Firebird Embedded, then the exit may produce an access violation (0xc0000005 error). The root cause is that the fbembed.dll/fbclient.dll will call fb_shutdown() itself, but one of the other libraries (eg fbintl.dll) may already have been unloaded.
To prevent this, on exit the .NET provider should explicitly call fb_shutdown for any of the native libries loaded (but especially for embedded).
See also "Crash Firebird 2.5.8 Embedded with Firebird http://Ado.net provider." on Firebird-devel.
Related: DNET802 (cleaning up the connection pool on exit will also prevent the access violation).
Maybe, but what I get from the reaction of Vlad is that it would be better to call fb_shutdown explicitly always when the native library has been loaded.
{
ShutdownHelper.RegisterFbClientShutdown(() => result.fb_shutdown(0, 0)); //This will throw the following error when connecting to Firebird 2.1 and earlier.
}
System.EntryPointNotFoundException
HResult=0x80131523
Message=Unable to find an entry point named 'fb_shutdown' in DLL 'J:\fbembed.dll'.
Source=FB_431220871_Assembly
StackTrace:
at FB_431220871_Class.fb_shutdown(Int32 timeout, Int32 reason)
at FB_431220871_Class.IFbClient.fb_shutdown(Int32 timeout, Int32 reason)
Yeah I know. Given the 2.1 is not supported by CORE either, I'd like to not bury myself with too much compatibility. Previous versions are still here and working. Yet it doesn't seem to be right, just because of this. Probably just wrapping in in try-catch and ignoring the EntryPointNotFoundException is good enough solution.
Submitted by: @mrotteveel
Is related to DNET802
If the apllication exits and there are still connections open using Firebird Embedded, then the exit may produce an access violation (0xc0000005 error). The root cause is that the fbembed.dll/fbclient.dll will call fb_shutdown() itself, but one of the other libraries (eg fbintl.dll) may already have been unloaded.
To prevent this, on exit the .NET provider should explicitly call fb_shutdown for any of the native libries loaded (but especially for embedded).
See also "Crash Firebird 2.5.8 Embedded with Firebird http://Ado.net provider." on Firebird-devel.
Related: DNET802 (cleaning up the connection pool on exit will also prevent the access violation).
Commits: 469bbac
The text was updated successfully, but these errors were encountered: