[compiler-rt] r271256 - [asan] Fix a deadlock halt_on_error-signals.c when `reporting_thread_tid_` is 0
Kuba Brecka via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 01:47:20 PDT 2016
Author: kuba.brecka
Date: Tue May 31 03:47:18 2016
New Revision: 271256
URL: http://llvm.org/viewvc/llvm-project?rev=271256&view=rev
Log:
[asan] Fix a deadlock halt_on_error-signals.c when `reporting_thread_tid_` is 0
A signal can be delivered after TryLock but before StartReporting in ScopedInErrorReport, causing a deadlock. Fixing this by statically initializing reporting_thread_tid_ to kInvalidTid.
Differential Revision: http://reviews.llvm.org/D20524
Modified:
compiler-rt/trunk/lib/asan/asan_report.cc
Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=271256&r1=271255&r2=271256&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Tue May 31 03:47:18 2016
@@ -736,7 +736,7 @@ class ScopedInErrorReport {
};
StaticSpinMutex ScopedInErrorReport::lock_;
-u32 ScopedInErrorReport::reporting_thread_tid_;
+u32 ScopedInErrorReport::reporting_thread_tid_ = kInvalidTid;
void ReportStackOverflow(const SignalContext &sig) {
ScopedInErrorReport in_report(/*report*/ nullptr, /*fatal*/ true);
More information about the llvm-commits
mailing list