summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-11-21 11:12:33 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-11-21 11:12:33 +0000
commit9ca2afd3a114c93b58f0826c69eb3a370b5a3d6a (patch)
treed3e6574760740eb1e8362bae318612b2e69e4a56
parent3233391b50713ca77404ccbe0891cc3baffcac72 (diff)
downloadbcm5719-llvm-9ca2afd3a114c93b58f0826c69eb3a370b5a3d6a.tar.gz
bcm5719-llvm-9ca2afd3a114c93b58f0826c69eb3a370b5a3d6a.zip
tsan: fix handling of signals
(do not execute synchronous signals in recursive interceptors) llvm-svn: 168421
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_interceptors.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
index 379de0b3ee1..35aacdcfd07 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
@@ -1228,8 +1228,10 @@ static void ALWAYS_INLINE rtl_generic_sighandler(bool sigact, int sig,
sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE ||
// If we are sending signal to ourselves, we must process it now.
(sctx && sig == sctx->int_signal_send) ||
- // If we are in blocking function, we can safely process it now.
- (sctx && sctx->in_blocking_func)) {
+ // If we are in blocking function, we can safely process it now
+ // (but check if we are in a recursive interceptor,
+ // i.e. pthread_join()->munmap()).
+ (sctx && sctx->in_blocking_func && thr->in_rtl == 1)) {
CHECK(thr->in_rtl == 0 || thr->in_rtl == 1);
int in_rtl = thr->in_rtl;
thr->in_rtl = 0;
OpenPOWER on IntegriCloud