tsan: improve "destroy of a locked mutex" reports
authorDmitry Vyukov <dvyukov@google.com>
Fri, 27 Apr 2018 08:59:35 +0000 (08:59 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 27 Apr 2018 08:59:35 +0000 (08:59 +0000)
commit21dc68fe7b4cd06b2ac194a66467352ddc2c4ecb
treeec16602c6cc40f9d020809100abf002d444fc1cc
parent1956a48d273dca31d379b3b032bf772040d3c93d
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
compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
compiler-rt/test/tsan/mutex_destroy_locked2.cc [new file with mode: 0644]
compiler-rt/test/tsan/suppressions_mutex.cc [new file with mode: 0644]
compiler-rt/test/tsan/suppressions_mutex.cc.supp [new file with mode: 0644]