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

Possible races while Service destruction [CORE4303] #4626

Closed
firebird-automations opened this issue Dec 24, 2013 · 8 comments
Closed

Possible races while Service destruction [CORE4303] #4626

firebird-automations opened this issue Dec 24, 2013 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @romansimakov

This destructor sometimes is called concurrently with existing Service::ExistenceGuard object in another thread
Service::~Service()
{
removeFromAllServices();

delete svc\_trace\_manager;
svc\_trace\_manager = NULL;

if \(svc\_current\_guard\)
\{
	svc\_current\_guard\-\>release\(\);
\}

}
Variable svc_current_guard is not null exactly in such moment. But after check another thread with ExistenceGuard can continue its work and ExistenceGuard object will be destroyed and svc_current_guard will be released. In this case ~Service will try to leave svc->svc_existence_lock the second time which leads to abort.

Commits: cb73693 a98e565 FirebirdSQL/fbt-repository@cbe27b4 FirebirdSQL/fbt-repository@ec4bc87

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 2.5.3 [ 10461 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

In trunk we also avoid cases when global services mutex may get locked for a relatively long time.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

@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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Cannot be tested

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