Issue Details (XML | Word | Printable)

Key: CORE-3993
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Zotov
Votes: 0
Watchers: 2

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

Server terminates or crashes while shutting down a database with in-progress attachments

Created: 21/Nov/12 06:45 PM   Updated: 18/Jan/16 03:50 PM
Component/s: Engine
Affects Version/s: 2.5.0, 2.5.1, 2.5.2
Fix Version/s: 3.0 Alpha 1, 2.5.3

Environment: The crash is Linux/UNIX specific, but the root of the issue is platform independent.
Issue Links:

QA Status: No test

 Description  « Hide
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/
#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/
#13 0x0093f3d4 in __do_global_dtors_aux () from /opt/fb25sc/lib/
#14 0x00cd19dc in _fini () from /opt/fb25sc/lib/
#15 0x0036a80e in _dl_fini () from /lib/
#16 0x003a5da9 in exit () from /lib/
-- 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/
#2 0x004f8dad in _L_lock_981 () from /lib/
#3 0x004f8ccb in pthread_mutex_lock () from /lib/
#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",

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.