New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebird crashes after unsuccessful remapping of the lock table's shared memory [CORE4500] #4819
Comments
Modified by: Y. Numai (y-numai)summary: Firebird embeded server crashes => Firebird embeded server crashes because of AccessViolationException |
Commented by: Sean Leyne (seanleyne) What path is the database file in? Have you confirmed that the local user has read/write access to this folder? |
Commented by: Y. Numai (y-numai) The answer for your first question is.... About the second question, I think you might misunderstand what I am talking about. My application insert data to the database for every minite. However, after this error-catch, "LockManager::bug()" is called at l.1150 at lock.cpp (Firebird-2.5.1.26351-0), Could you see the actual code and review this issue? Thank you. |
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Modified by: @dyemanovsummary: Firebird embeded server crashes because of AccessViolationException => Firebird crashes after unsuccessful remapping of the lock table's shared memory |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 1 [ 10332 ] Fix Version: 2.5.4 [ 10585 ] |
Commented by: @dyemanov It should be fixed now, thanks. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Y. Numai (y-numai)
My C# Windows Service Application uses .NET Data Provider and FB Embeded server (fbembed.dll).
However, it sometimes crashes when it connects to a firebird database file.
===EventLog(Application) EID 1026===
Exception: System.AccessViolationException
Stack:
at FB_1236665269_Class.isc_attach_database(IntPtr[], Int16, Byte[], Int32 ByRef, Int16, Byte[])
at FB_1236665269_Class.isc_attach_database(IntPtr[], Int16, Byte[], Int32 ByRef, Int16, Byte[])
at FirebirdSql.Data.Client.Native.FesDatabase.Attach(FirebirdSql.Data.Common.DatabaseParameterBuffer, System.String, Int32, System.String)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
...
===EventLog(Application) EID 1000===
Faulting application name: MyApp.exe, version: 1.0.1.0, time stamp: 0x52eb5d90
Faulting module name: fbembed.DLL, version: 2.5.1.26351, time stamp: 0x4e89609d
Exception code: 0xc0000005
Fault offset: 0x000000000027963b
Faulting process id: 0x450
Faulting application start time: 0x01cf7f979c1b46a3
Faulting application path: C:\Program Files\MyApp\MyApp.exe
Faulting module path: C:\Program Files\MyApp\fbembed.DLL
...
When my app crashed, it created firebird.log as below.
====firebird.log=====
ServerName Fri Jun 20 23:51:31 2014
Fatal lock manager error: ISC_map_file failed (reattach shared file), errno: 1224
I investigated my application crash dump file, and I finally found out that my app has crashed at fwrite()
in the method "LockManager::bug()."
====ll.1651-1655 at Firebird-2.5.1.26351-0\src\lock\lock.cpp, ====
if (fd)
{
fwrite(m_header, 1, m_header->lhb_used, fd);
fclose(fd);
}
I have a hunch that if "LockManager::acquire_shmem()" failed to "attach_shared_file" (l.1149 at lock.cpp), it calls "LockManager::bug()" (l.1150 at lock.cpp).
"LockManager::bug()" referes "m_header->lhb_used" as it shows above.
However, if "LockManager::attach_shared_file()" fails, m_header will be NULL.
====ll.337-340 at Firebird-2.5.1.26351-0\src\lock\lock.cpp, ====
m_header = (lhb*) ISC_map_file(status, name.c_str(), initialize, this, m_memorySize, &m_shmem);
==================================================================
Therefore, NULL-reference seems to occur at "fwrite(m_header, 1, m_header->lhb_used, fd)."
Commits: cb90a3a 31bdbe0 FirebirdSQL/fbt-repository@03e6250 FirebirdSQL/fbt-repository@fe8a70e
The text was updated successfully, but these errors were encountered: