-
Notifications
You must be signed in to change notification settings - Fork 124
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
Prevent undefined behaviour during process exit #285
Conversation
For the record, this PR fixes the following deadlock in multithreadtest, when using XMLSocketAppender to connect to a TCP port that does not have a server process listening. Thread 5 (Thread 0x7f4287fff640 (LWP 7247) "multithreadtest"): Thread 4 (Thread 0x7f428c9a8640 (LWP 7246) "multithreadtest"): Thread 3 (Thread 0x7f428d1a9640 (LWP 7245) "multithreadtest"): Thread 2 (Thread 0x7f428d9aa640 (LWP 7244) "multithreadtest"): Thread 1 (Thread 0x7f428df20b80 (LWP 7243) "multithreadtest"): |
When some background threads call LogLog::debug on exit which can be after the static LogLogPrivate pointer is deleted by the onexit processing chain.
PR #219 was not sufficient to fix this because the raw pointer held by std::unique_pointer is not zeroed by the std::unique_pointer destructor.