summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-27 08:59:35 +0000
committerDmitry Vyukov <dvyukov@google.com>2018-04-27 08:59:35 +0000
commit21dc68fe7b4cd06b2ac194a66467352ddc2c4ecb (patch)
treeec16602c6cc40f9d020809100abf002d444fc1cc /compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
parent1956a48d273dca31d379b3b032bf772040d3c93d (diff)
downloadbcm5719-llvm-21dc68fe7b4cd06b2ac194a66467352ddc2c4ecb.tar.gz
bcm5719-llvm-21dc68fe7b4cd06b2ac194a66467352ddc2c4ecb.zip
tsan: improve "destroy of a locked mutex" reports
1. Allow to suppress by current stack. We generally allow to suppress by all main stacks. Current is probably the stack one wants to use to suppress such reports. 2. Fix last lock stack restoration. We trimmed shadow value by storing it in u32. This magically worked for the test that provoked the report on the main thread. But this breaks for locks in any other threads. llvm-svn: 331023
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
index 152b965ad53..f0f4fbe7c7c 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
@@ -104,7 +104,7 @@ void MutexDestroy(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {
unlock_locked = true;
}
u64 mid = s->GetId();
- u32 last_lock = s->last_lock;
+ u64 last_lock = s->last_lock;
if (!unlock_locked)
s->Reset(thr->proc()); // must not reset it before the report is printed
s->mtx.Unlock();
@@ -114,7 +114,7 @@ void MutexDestroy(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {
rep.AddMutex(mid);
VarSizeStackTrace trace;
ObtainCurrentStack(thr, pc, &trace);
- rep.AddStack(trace);
+ rep.AddStack(trace, true);
FastState last(last_lock);
RestoreStack(last.tid(), last.epoch(), &trace, 0);
rep.AddStack(trace, true);
OpenPOWER on IntegriCloud