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

AV in client/embedded library when unloading it [CORE2158] #2589

Closed
firebird-automations opened this issue Oct 29, 2008 · 6 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @AlexPeshkoff

When dlclose() is called for any firebird library, shutdownThread sometimes does not close successfully. This is due to the frame between finalizing semaphore release and actual thread completion, during which OS can throw that thread away from CPU, and when it's activated once again - code to be executed is not available any more.

Commits: cdc4458

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

The only reliable way to know that thread is really finished is to use thread-level (pthread_join, WaitForSingleObject) OS-dependent functions. To avoid OS dependency in main code added ThreadHandle typedef (address of such variable is passed to gds__thread_start()) and 2 new functions - THD_detach() and THD_wait_for_completion(). Ideally THD_wait_for_completion() should be used all over the engine instead of finalizing semaphores, but I've started with shutdownThread(), where it's specially critical.
Also fixed posix's gds__thread_start() making it not ignore last parameter. Solaris threads are not fixed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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