llvm-project/lldb/source/Initialization
Pavel Labath d813309e03 Logging: Disable logging after fork()
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 disable logging in the forked child.

Reviewers: zturner, eugene, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D38938

llvm-svn: 316368
2017-10-23 19:41:17 +00:00
..
CMakeLists.txt [CMake] Final dependency cleanup patch! 2017-02-08 21:00:46 +00:00
SystemInitializer.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
SystemInitializerCommon.cpp Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
SystemLifetimeManager.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00