diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2016-04-04 10:52:59 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2016-04-04 10:52:59 +0000 |
commit | e30e2e5542939d4d95565b6341edeab3d2889e7b (patch) | |
tree | 63105d8c295cabaebdf3fec5254c70329f9e1b07 /lib | |
parent | e8d59212969569209cb29a86fbc70641a8e2182e (diff) |
tsan: fix ignore handling in signal handlers
We've reset thr->ignore_reads_and_writes, but forget to do
thr->fast_state.ClearIgnoreBit(). So ignores were not effective
reset and fast_state.ignore_bit was corrupted if signal handler
itself uses ignores.
Properly reset/restore fast_state.ignore_bit around signal handlers.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tsan/rtl/tsan_interceptors.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_interceptors.cc b/lib/tsan/rtl/tsan_interceptors.cc index 2b846320b..6bddc3f37 100644 --- a/lib/tsan/rtl/tsan_interceptors.cc +++ b/lib/tsan/rtl/tsan_interceptors.cc @@ -1887,6 +1887,7 @@ static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire, int ignore_sync = thr->ignore_sync; if (!ctx->after_multithreaded_fork) { thr->ignore_reads_and_writes = 0; + thr->fast_state.ClearIgnoreBit(); thr->ignore_interceptors = 0; thr->ignore_sync = 0; } @@ -1907,6 +1908,8 @@ static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire, } if (!ctx->after_multithreaded_fork) { thr->ignore_reads_and_writes = ignore_reads_and_writes; + if (ignore_reads_and_writes) + thr->fast_state.SetIgnoreBit(); thr->ignore_interceptors = ignore_interceptors; thr->ignore_sync = ignore_sync; } |