summaryrefslogtreecommitdiff
path: root/lib/asan/asan_report.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-04-05 07:30:29 +0000
committerAlexey Samsonov <samsonov@google.com>2013-04-05 07:30:29 +0000
commit7ed46ff7af911da0dd2067734d1408c6986c6657 (patch)
treed1108ca92e40aa5ffd65528ce61fac03a7539615 /lib/asan/asan_report.cc
parent6a7c51db8449fa948990501e65db4e71bf58e198 (diff)
downloadcompiler-rt-7ed46ff7af911da0dd2067734d1408c6986c6657.tar.gz
compiler-rt-7ed46ff7af911da0dd2067734d1408c6986c6657.tar.bz2
compiler-rt-7ed46ff7af911da0dd2067734d1408c6986c6657.tar.xz
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_report.cc')
-rw-r--r--lib/asan/asan_report.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/asan/asan_report.cc b/lib/asan/asan_report.cc
index b3c9c5e5..8bc5c4f5 100644
--- a/lib/asan/asan_report.cc
+++ b/lib/asan/asan_report.cc
@@ -458,10 +458,12 @@ class ScopedInErrorReport {
internal__exit(flags()->exitcode);
}
ASAN_ON_ERROR();
- // Make sure the registry is locked while we're printing an error report.
- // We can lock the registry only here to avoid self-deadlock in case of
+ // Make sure the registry and sanitizer report mutexes are locked while
+ // we're printing an error report.
+ // We can lock them only here to avoid self-deadlock in case of
// recursive reports.
asanThreadRegistry().Lock();
+ CommonSanitizerReportMutex.Lock();
reporting_thread_tid = GetCurrentTidOrInvalid();
Printf("===================================================="
"=============\n");