Issue Details (XML | Word | Printable)

Key: CORE-3400
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: YuriP
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Server crash every 3 hour (FreeBSD8.2R)

Created: 19/Mar/11 08:44 PM   Updated: 23/Apr/13 11:50 AM
Component/s: None
Affects Version/s: 2.5.0
Fix Version/s: 2.5.1

Time Tracking:
Not Specified

Environment:
FreeBSD 8.2-RELEASE amd64
Intel Xeon E5310
8Gb RAM

Planning Status: Unspecified


 Description  « Hide
Every 3 hour Firebird crash with log :

        Sat Mar 19 18:08:14 2011
        Fatal lock manager error: mutex init failed, errno: 22
 (Client) Sat Mar 19 18:08:14 2011
        /usr/local/bin/fbguard: /usr/local/sbin/fb_smp_server terminated abnormally (-1)
 (Client) Sat Mar 19 18:08:14 2011
        /usr/local/bin/fbguard: guardian starting /usr/local/sbin/fb_smp_server



        Sat Mar 19 21:31:13 2011
        Fatal lock manager error: mutex init failed, errno: 22
 (Client) Sat Mar 19 21:31:14 2011
        /usr/local/bin/fbguard: /usr/local/sbin/fb_smp_server terminated abnormally (-1)

 (Client) Sat Mar 19 21:31:14 2011
        /usr/local/bin/fbguard: guardian starting /usr/local/sbin/fb_smp_server

Core dump backtrace:

#0 0x0000000800824cc8 in ISC_unmap_file () from /usr/local/lib/libfbembed.so.2.5
#1 0x000000080096c465 in Jrd::LockManager::detach_shared_file () from /usr/local/lib/libfbembed.so.2.5
#2 0x00000008009730c0 in Jrd::LockManager::~LockManager () from /usr/local/lib/libfbembed.so.2.5
#3 0x0000000800700d80 in Firebird::RefCounted::release () from /usr/local/lib/libfbembed.so.2.5
#4 0x000000080084510b in Jrd::Database::~Database () from /usr/local/lib/libfbembed.so.2.5
#5 0x00000008008269d3 in shutdown_database () from /usr/local/lib/libfbembed.so.2.5
#6 0x00000008008314e3 in purge_attachment () from /usr/local/lib/libfbembed.so.2.5
#7 0x00000008008325a7 in jrd8_detach_database () from /usr/local/lib/libfbembed.so.2.5
#8 0x00000008006fd994 in detach_or_drop_database () from /usr/local/lib/libfbembed.so.2.5
#9 0x0000000800876a40 in Jrd::SecurityDatabase::closeDatabase () from /usr/local/lib/libfbembed.so.2.5
#10 0x0000000800877282 in Jrd::SecurityDatabase::onShutdown () from /usr/local/lib/libfbembed.so.2.5
#11 0x000000080087735c in Jrd::SecurityDatabase::onShutdown () from /usr/local/lib/libfbembed.so.2.5
#12 0x0000000800700463 in fb_shutdown () from /usr/local/lib/libfbembed.so.2.5
#13 0x00000008009eeaf2 in Firebird::InstanceControl::destructors () from /usr/local/lib/libfbembed.so.2.5
#14 0x00000008009eeb99 in __tcf_0 () from /usr/local/lib/libfbembed.so.2.5
#15 0x000000080140ebf6 in __cxa_finalize () from /lib/libc.so.7
#16 0x00000008006de773 in __do_global_dtors_aux () from /usr/local/lib/libfbembed.so.2.5
#17 0x00000008005849c0 in ?? ()
#18 0x00000008009fad61 in _fini () from /usr/local/lib/libfbembed.so.2.5
#19 0x0000000800584980 in ?? ()
#20 0x000000080055ad31 in dlsym () from /libexec/ld-elf.so.1
#21 0x000000080055aeee in dlclose () from /libexec/ld-elf.so.1
#22 0x000000080140ec04 in __cxa_finalize () from /lib/libc.so.7
#23 0x00000008013baf57 in exit () from /lib/libc.so.7
#24 0x000000080096c2cc in Jrd::LockManager::bug () from /usr/local/lib/libfbembed.so.2.5
#25 0x000000080096d250 in Jrd::LockManager::initialize () from /usr/local/lib/libfbembed.so.2.5
#26 0x00000008008241b2 in ISC_map_file () from /usr/local/lib/libfbembed.so.2.5
#27 0x000000080096d706 in Jrd::LockManager::attach_shared_file () from /usr/local/lib/libfbembed.so.2.5
#28 0x0000000800971890 in Jrd::LockManager::LockManager () from /usr/local/lib/libfbembed.so.2.5
#29 0x0000000800972063 in Jrd::LockManager::create () from /usr/local/lib/libfbembed.so.2.5
#30 0x00000008008348cf in jrd8_attach_database () from /usr/local/lib/libfbembed.so.2.5
#31 0x00000008006ffa7b in isc_attach_database () from /usr/local/lib/libfbembed.so.2.5
#32 0x000000000040e14c in attach_database ()
#33 0x0000000000412cd4 in process_packet ()
#34 0x0000000000413a65 in loopThread ()
#35 0x00000008006edf9b in (anonymous namespace)::threadStart () from /usr/local/lib/libfbembed.so.2.5
#36 0x000000080122c4f1 in pthread_getprio () from /lib/libthr.so.3
#37 0x00007ffffebf8000 in ?? ()

It's core dump was create because exit procedure, initated from LockManager , is not correct, but It dump cann't show, what problem was be with lockmanager.
 I suspect that procedures in src/jrs/ics_sync.cpp not fully tested on FreeBSD, and work with semaphores not fully correct.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 21/Mar/11 07:45 AM
Core dump is correct - here is
#24 0x000000080096c2cc in Jrd::LockManager::bug () from /usr/local/lib/libfbembed.so.2.5
 #25 0x000000080096d250 in Jrd::LockManager::initialize () from /usr/local/lib/libfbembed.so.2.5
 #26 0x00000008008241b2 in ISC_map_file () from /usr/local/lib/libfbembed.so.2.5
sequence which caused real error. Superclassic tried to close, but failed to do it smart.

Procedures in ics_sync.cpp are really not full tested on FreeBSD, but same code is used on MacOS (it has same with freebsd problem with missing shared mutexes). The state of freebsd 2.5 port is as follows - I've made it build without fatal errors and made sure that it's passing minimum(!) tests. The worst is the fact that this OS does miss efficient cross-process sync tools (shared mutexes and shared condition variable), which makes is definitely less efficient for FB 2.5 compared with linux.

Anyway - at the first glance looks like you've found a bug. If you wish to take part it fixing it - please contact me privately (peshkoff at mail dot ru).

Alexander Peshkov added a comment - 01/Jul/11 10:18 AM
Issue appears to be fixed - but I did not get final confirmation from Yuri.