Server crashes while shutting down a database with in-progress attachments
--------------------------------------------------------------------------
Key: CORE-3993
URL: http://tracker.firebirdsql.org/browse/CORE-3993
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
Environment: The crash is Linux/UNIX specific, but the root of the
issue is platform independent.
Reporter: Dmitry Yemanov
The shutdown AST is delivered to the database with the already released locks.
It causes a fatal lock manager error forcing the server process to exit. During
the cleanup, server crashes with a segfault due to the memory pools being
already destroyed.
The backtrace:
Thread 1 (Thread 13230):
-- crash specific part
#0 0x004f8c2d in pthread_mutex_lock () from /lib/libpthread.so.0
#1 0x08072155 in enter (this=0x0) at
../src/remote/../remote/../jrd/../common/classes/locks.h:170
#2 MutexLockGuard (this=0x0) at
../src/remote/../remote/../jrd/../common/classes/locks.h:246
#3 PortsCleanup::closePorts (this=0x0) at ../src/remote/remote.cpp:782
#4 0x08068617 in cleanup_ports () at ../src/remote/inet.cpp:1805
#5 0x00959a2c in run (timeout=5000, reason=-7) at ../src/jrd/why.cpp:642
#6 fb_shutdown (timeout=5000, reason=-7) at ../src/jrd/why.cpp:5994
#7 0x00959fd6 in (anonymous namespace)::atExitShutdown () at
../src/jrd/why.cpp:918
#8 0x00cc46fe in Firebird::InstanceControl::destructors () at
../src/common/classes/init.cpp:157
#9 0x00cc4767 in allClean () at ../src/common/classes/init.cpp:61
#10 ~Cleanup () at ../src/common/classes/init.cpp:89
#11 __tcf_0 () at ../src/common/classes/init.cpp:93
#12 0x003a6059 in __cxa_finalize () from /lib/libc.so.6
#13 0x0093f3d4 in __do_global_dtors_aux () from
/opt/fb25sc/lib/libfbembed.so.2.5
#14 0x00cd19dc in _fini () from /opt/fb25sc/lib/libfbembed.so.2.5
#15 0x0036a80e in _dl_fini () from /lib/ld-linux.so.2
#16 0x003a5da9 in exit () from /lib/libc.so.6
-- generic part
#17 0x00c2826c in Jrd::LockManager::bug (this=0xb7f86ac4, status_vector=0x0,
string=0xb039208c "invalid lock id (0)")
#18 0x00c283c9 in Jrd::LockManager::get_request (this=0xb7f86ac4, offset=0) at
../src/lock/lock.cpp:2224
#19 0x00c2e7b4 in Jrd::LockManager::convert (this=0xb7f86ac4, tdbb=0xb0392264,
request_offset=0, type=4 '\004',
#20 0x00ad39e5 in CONVERT (tdbb=0xb0392264, lock=0x529c2890, level=4, wait=1)
at ../src/jrd/lck.cpp:153
#21 LCK_convert (tdbb=0xb0392264, lock=0x529c2890, level=4, wait=1) at
../src/jrd/lck.cpp:321
#22 0x00a336b8 in CCH_down_grade_dbb (ast_object=0x529c90d4) at
../src/jrd/cch.cpp:446
#23 0x00c2c03e in Jrd::LockManager::blocking_action (this=0xb7f86ac4, tdbb=0x0,
blocking_owner_offset=233240,
#24 0x00c2d3db in Jrd::LockManager::blocking_action_thread (this=0xb7f86ac4) at
../src/lock/lock.cpp:1567
Thread 67 (Thread 13232):
#0 0x0064e402 in __kernel_vsyscall ()
#1 0x004fd6e9 in __lll_lock_wait () from /lib/libpthread.so.0
#2 0x004f8dad in _L_lock_981 () from /lib/libpthread.so.0
#3 0x004f8ccb in pthread_mutex_lock () from /lib/libpthread.so.0
#4 0x00c2f03e in enter (this=0xb7f86ac4, tdbb=0xad2e1b9c,
owner_offset=0x529c9478)
#5 lock (this=0xb7f86ac4, tdbb=0xad2e1b9c, owner_offset=0x529c9478) at
../src/lock/../jrd/../jrd/Database.h:139
#6 ~Checkout (this=0xb7f86ac4, tdbb=0xad2e1b9c, owner_offset=0x529c9478) at
../src/lock/../jrd/../jrd/Database.h:240
#7 Jrd::LockManager::shutdownOwner (this=0xb7f86ac4, tdbb=0xad2e1b9c,
owner_offset=0x529c9478)
#8 0x00ad2930 in LCK_fini (tdbb=0xad2e1b9c, owner_type=LCK_OWNER_database) at
../src/jrd/lck.cpp:464
#9 0x00aae76b in shutdown_database (dbb=0x529c90d4, release_pools=true) at
../src/jrd/jrd.cpp:5975
#10 0x00aaf523 in unwindAttach (ex=<value optimized out>,
userStatus=0xad2e2158, tdbb=<value optimized out>,
#11 0x00aba091 in jrd8_attach_database (user_status=<value optimized out>,
filename=0x11ed9c80 "/tmp/idx_test",
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel