llvm-project/lldb/source/Host
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
..
android *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
common Remove shared_pointer from NativeThreadProtocol 2017-10-17 15:52:16 +00:00
freebsd FreeBSD: attach to pid from different cwd 2017-09-03 01:41:31 +00:00
linux Clean up lldb-types.h 2017-07-18 13:14:01 +00:00
macosx update xpc service name. 2017-08-29 04:28:48 +00:00
netbsd Remove dead Core/StreamFile includes 2017-06-30 11:31:13 +00:00
openbsd Remove dead Core/StreamFile includes 2017-06-30 11:31:13 +00:00
posix Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
windows Remove dead Core/StreamFile includes 2017-06-30 11:31:13 +00:00
CMakeLists.txt Use ThreadLauncher to launch TaskPool threads 2017-09-19 15:38:30 +00:00