diff options
| author | Pavel Labath <labath@google.com> | 2017-10-19 17:40:51 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-10-19 17:40:51 +0000 |
| commit | 6c3c02a3bd6a5703dd6b22c8254e92961d57d31d (patch) | |
| tree | 73c85cef0858b8bf8c3305f52ada5b6ea5dfab25 /lldb/source/Initialization | |
| parent | 52f0885d4323b85cfed79416de9595e7cbb3ce53 (diff) | |
| download | bcm5719-llvm-6c3c02a3bd6a5703dd6b22c8254e92961d57d31d.tar.gz bcm5719-llvm-6c3c02a3bd6a5703dd6b22c8254e92961d57d31d.zip | |
Logging: Make sure logging machinery is in a consistent state after forking
Summary:
We had a bug where if we had forked (in the ProcessLauncherPosixFork)
while another thread was writing a log message, we would deadlock. This
happened because the fork child inherited the locked log rwmutex, which
would never get unlocked. This meant the child got stuck trying to
disable all log channels.
The bug existed for a while but only started being apparent after
D37930, which started using ThreadLauncher (which uses logging) instead
of std::thread (which does not) for launching TaskPool threads.
The fix is to use pthread_atfork to make sure noone is writing a log
message while we are forking.
Reviewers: zturner, eugene, clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D38938
llvm-svn: 316173
Diffstat (limited to 'lldb/source/Initialization')
| -rw-r--r-- | lldb/source/Initialization/SystemInitializerCommon.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp index e76ba4122bb..853547051ff 100644 --- a/lldb/source/Initialization/SystemInitializerCommon.cpp +++ b/lldb/source/Initialization/SystemInitializerCommon.cpp @@ -70,7 +70,7 @@ void SystemInitializerCommon::Initialize() { #endif llvm::EnablePrettyStackTrace(); - InitializeLog(); + Log::Initialize(); HostInfo::Initialize(); static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION); |

