summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_deadlock_detector.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2014-12-18 14:02:28 +0000
committerDmitry Vyukov <dvyukov@google.com>2014-12-18 14:02:28 +0000
commit9a8efe3ef5d2b6ef628acb242611efe50165d518 (patch)
treeeb5ac68f3964a0df98ddbfe224bcb7304f256a79 /lib/sanitizer_common/sanitizer_deadlock_detector.h
parentfa0cad405c5ba09d2d40388461587d648bdb5ddb (diff)
tsan: fix failing CHECK In deadlock detector
and re-enable the test git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_deadlock_detector.h')
-rw-r--r--lib/sanitizer_common/sanitizer_deadlock_detector.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_deadlock_detector.h b/lib/sanitizer_common/sanitizer_deadlock_detector.h
index 90e1cc4eb..c3ca210a1 100644
--- a/lib/sanitizer_common/sanitizer_deadlock_detector.h
+++ b/lib/sanitizer_common/sanitizer_deadlock_detector.h
@@ -50,6 +50,8 @@ class DeadlockDetectorTLS {
if (epoch_ == current_epoch) return;
bv_.clear();
epoch_ = current_epoch;
+ n_recursive_locks = 0;
+ n_all_locks_ = 0;
}
uptr getEpoch() const { return epoch_; }
@@ -83,7 +85,8 @@ class DeadlockDetectorTLS {
}
}
// Printf("remLock: %zx %zx\n", lock_id, epoch_);
- CHECK(bv_.clearBit(lock_id));
+ if (!bv_.clearBit(lock_id))
+ return; // probably addLock happened before flush
if (n_all_locks_) {
for (sptr i = n_all_locks_ - 1; i >= 0; i--) {
if (all_locks_with_contexts_[i].lock == static_cast<u32>(lock_id)) {