summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-10-28 12:29:32 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-10-28 12:29:32 +0000
commit33dd200ba9fccb1eb4ab8f022809405533684b3a (patch)
tree469eb7a26e9b7ee2487719067e63210f051dc065 /compiler-rt/lib/tsan
parent981fdeb477822c765cefc13f26b802f74b4eead3 (diff)
downloadbcm5719-llvm-33dd200ba9fccb1eb4ab8f022809405533684b3a.tar.gz
bcm5719-llvm-33dd200ba9fccb1eb4ab8f022809405533684b3a.zip
tsan: start the background thread with signals blocked, otherwise it can steal users signals
llvm-svn: 193519
Diffstat (limited to 'compiler-rt/lib/tsan')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_interceptors.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
index d888cdbc51b..1131ddcb27b 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
@@ -2191,9 +2191,15 @@ void InitializeInterceptors() {
}
void internal_start_thread(void(*func)(void *arg), void *arg) {
+ // Start the thread with signals blocked, otherwise it can steal users
+ // signals.
+ __sanitizer_kernel_sigset_t set, old;
+ internal_sigfillset(&set);
+ internal_sigprocmask(SIG_SETMASK, &set, &old);
void *th;
REAL(pthread_create)(&th, 0, (void*(*)(void *arg))func, arg);
REAL(pthread_detach)(th);
+ internal_sigprocmask(SIG_SETMASK, &old, 0);
}
} // namespace __tsan
OpenPOWER on IntegriCloud