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

SuperServer could hung on database shutdown [CORE4952] #5243

Closed
firebird-automations opened this issue Oct 3, 2015 · 5 comments
Closed

SuperServer could hung on database shutdown [CORE4952] #5243

firebird-automations opened this issue Oct 3, 2015 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Internal deadlock could happen when database is shutting down.

1. Shutdown thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Semaphore::tryEnter+0x20
03 engine12!CCH_shutdown+0x169
04 engine12!JRD_shutdown_database+0x571

CCH_shutdown owns bcb->bcb_syncObject and waits for bcb->bcb_writer_sem semaphore (signalling that cache_writer thread is gone)

2. cache_writer thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Synchronize::sleep+0x16
03 engine12!Firebird::Synchronize::sleep+0xe
04 engine12!Firebird::SyncObject::wait+0xbb
05 engine12!Firebird::SyncObject::lock+0xab
06 engine12!get_buffer+0x1ba
07 engine12!cache_writer+0x2a8

cache_writer waits for bcb->bcb_syncObject forever and can't release bcb->bcb_writer_sem semaphore

Commits: 79e9404 FirebirdSQL/fbt-repository@a69b7fc

====== Test Details ======

Any suggestions about scenario how to check this using ISQL session(s) ?

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC 1 [ 10584 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

description: Internal deadlock could happen when database is shutting down.

1. Shutdown thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Semaphore::tryEnter+0x20
03 engine12!CCH_shutdown+0x169
04 engine12!JRD_shutdown_database+0x571

engine12!Firebird::IProviderBaseImpl<Jrd::JProvider,Firebird::CheckStatusWrapper,Firebird::IPluginBaseImpl<Jrd::JProvider,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IReferenceCountedImpl<Jrd::JProvider,Firebird::
CCH_shutdown owns bcb->bcb_syncObject and waits for bcb->bcb_writer_sem semaphor (signalling that cache_writer thread is gone)

2. cache_writer thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Synchronize::sleep+0x16
03 engine12!Firebird::Synchronize::sleep+0xe
04 engine12!Firebird::SyncObject::wait+0xbb
05 engine12!Firebird::SyncObject::lock+0xab
06 engine12!get_buffer+0x1ba
07 engine12!cache_writer+0x2a8

cache_writer waits for bcb->bcb_syncObject forever

=>

Internal deadlock could happen when database is shutting down.

1. Shutdown thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Semaphore::tryEnter+0x20
03 engine12!CCH_shutdown+0x169
04 engine12!JRD_shutdown_database+0x571

CCH_shutdown owns bcb->bcb_syncObject and waits for bcb->bcb_writer_sem semaphore (signalling that cache_writer thread is gone)

2. cache_writer thread

00 ntdll!KiFastSystemCallRet
01 kernel32!WaitForSingleObject+0x12
02 engine12!Firebird::Synchronize::sleep+0x16
03 engine12!Firebird::Synchronize::sleep+0xe
04 engine12!Firebird::SyncObject::wait+0xbb
05 engine12!Firebird::SyncObject::lock+0xab
06 engine12!get_buffer+0x1ba
07 engine12!cache_writer+0x2a8

cache_writer waits for bcb->bcb_syncObject forever and can't release bcb->bcb_writer_sem semaphore

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: Any suggestions about scenario how to check this using ISQL session(s) ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Sascha Michel (datiscum1)

I hope the problem can be fixed even in 2.5.5, before it is released.

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

No branches or pull requests

2 participants