Skip to content
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

Server terminates or crashes while shutting down a database with in-progress attachments [CORE3993] #4325

Closed
firebird-automations opened this issue Nov 21, 2012 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Is related to CORE3935

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",

Commits: 272ac70 046c1c6 6f5fede 7ee2887 3746843 c7454a4 74938ad FirebirdSQL/fbt-repository@984a24f FirebirdSQL/fbt-repository@76a094e FirebirdSQL/fbt-repository@c243cf1 FirebirdSQL/fbt-repository@0a2a1c4 FirebirdSQL/fbt-repository@41b2529

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Pavel Zotov [ tabloid ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Server crashes while shutting down a database with in-progress attachments => Server terminates or crashes while shutting down a database with in-progress attachments

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Dmitry Yemanov [ dimitr ] => Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Link: This issue is related to CORE3935 [ CORE3935 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.5.3 [ 10461 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment