llvm-project/lldb
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
..
cmake Check availability of accept4 in C++ instad of C code. 2017-09-16 02:58:49 +00:00
docs Adding Support for Error Strings in Remote Packets 2017-07-12 11:15:34 +00:00
examples The save_crashlog command was still looking at lldb.target and 2017-10-12 02:21:41 +00:00
include/lldb Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
lit Resubmit "[lit] Force site configs to run before source-tree configs" 2017-09-15 22:10:46 +00:00
lldb.xcodeproj Remove the input file specification from the 2017-10-07 00:13:10 +00:00
lldb.xcworkspace
packages/Python/lldbsuite [lldbtest] Simplify removing an unneeded else. NFCI. 2017-10-23 17:51:22 +00:00
resources
scripts Reverting r315966 - it caused a build failure on an ubuntu x android bot. 2017-10-17 03:13:39 +00:00
source Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
test cmake build needs to run tests AND collect results 2017-07-18 23:45:06 +00:00
third_party/Python/module
tools Remove default case from switch. 2017-10-11 19:38:35 +00:00
unittests lldb-server tests: Propagate environment variables (pr34192) 2017-10-20 22:39:18 +00:00
utils
www Mention breakpoint names in the tutorial. 2017-09-14 22:20:31 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt [CMake] Add LLDB_INCLUDE_TESTS variable 2017-10-06 22:21:36 +00:00
CODE_OWNERS.txt Greg Clayton is no longer working at Apple, he will continue to 2017-03-01 00:00:45 +00:00
INSTALL.txt
LICENSE.TXT
use_lldb_suite_root.py