summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_symbolizer_internal.h
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2018-02-11 19:23:42 +0000
committerKuba Mracek <mracek@apple.com>2018-02-11 19:23:42 +0000
commit2ad995068aa4473e6a870a53bfbeb33e19e5ca80 (patch)
tree93b005cf94a03a27f8b39ce7d49913b281a5b318 /lib/sanitizer_common/sanitizer_symbolizer_internal.h
parentcc0ab3fcf3c94169afdb905f02597cd9dead30ff (diff)
downloadcompiler-rt-2ad995068aa4473e6a870a53bfbeb33e19e5ca80.tar.gz
[compiler-rt] Replace forkpty with posix_spawn
On Darwin, we currently use forkpty to communicate with the "atos" symbolizer. There are several problems that fork or forkpty has, e.g. that after fork, interceptors are still active and this sometimes causes crashes or hangs. This is especially problematic for TSan, which uses interceptors for OS-provided locks and mutexes, and even Libc functions use those. This patch replaces forkpty with posix_spawn. Since posix_spawn doesn't fork (at least on Darwin), the interceptors are not a problem. Additionally, this also fixes a latent threading problem with ptsname (it's unsafe to use this function in multithreaded programs). Yet another benefit is that we'll handle post-fork failures (e.g. sandbox disallows "exec") gracefully now. Differential Revision: https://reviews.llvm.org/D40032 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_symbolizer_internal.h')
-rw-r--r--lib/sanitizer_common/sanitizer_symbolizer_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_symbolizer_internal.h b/lib/sanitizer_common/sanitizer_symbolizer_internal.h
index a2ac11882..ada0867f8 100644
--- a/lib/sanitizer_common/sanitizer_symbolizer_internal.h
+++ b/lib/sanitizer_common/sanitizer_symbolizer_internal.h
@@ -72,7 +72,7 @@ class SymbolizerTool {
// SymbolizerProcess may not be used from two threads simultaneously.
class SymbolizerProcess {
public:
- explicit SymbolizerProcess(const char *path, bool use_forkpty = false);
+ explicit SymbolizerProcess(const char *path, bool use_posix_spawn = false);
const char *SendCommand(const char *command);
protected:
@@ -109,7 +109,7 @@ class SymbolizerProcess {
uptr times_restarted_;
bool failed_to_start_;
bool reported_invalid_path_;
- bool use_forkpty_;
+ bool use_posix_spawn_;
};
class LLVMSymbolizerProcess;