diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:30:29 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:30:29 +0000 |
commit | 734aab406628625706e021143fedb70de8be3f04 (patch) | |
tree | b08178e014cd77948b39df0d2e4cd58d7e2d668c /compiler-rt/lib/tsan/rtl/tsan_rtl.cc | |
parent | 3eb78ec974c395dd92d63f6fe912a38c133188ea (diff) | |
download | bcm5719-llvm-734aab406628625706e021143fedb70de8be3f04.tar.gz bcm5719-llvm-734aab406628625706e021143fedb70de8be3f04.zip |
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
llvm-svn: 178853
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.cc')
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 9209cd70f6a..68f195355da 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -152,6 +152,7 @@ static void BackgroundThread(void *arg) { memory_order_relaxed); if (last != 0 && last + flags()->flush_symbolizer_ms * kMs2Ns < now) { Lock l(&ctx->report_mtx); + SpinMutexLock l2(&CommonSanitizerReportMutex); SymbolizeFlush(); atomic_store(&ctx->last_symbolize_time_ns, 0, memory_order_relaxed); } @@ -253,6 +254,8 @@ int Finalize(ThreadState *thr) { // Wait for pending reports. ctx->report_mtx.Lock(); + CommonSanitizerReportMutex.Lock(); + CommonSanitizerReportMutex.Unlock(); ctx->report_mtx.Unlock(); #ifndef TSAN_GO |