From 9a8efe3ef5d2b6ef628acb242611efe50165d518 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 18 Dec 2014 14:02:28 +0000 Subject: 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 --- lib/sanitizer_common/sanitizer_deadlock_detector.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sanitizer_common/sanitizer_deadlock_detector.h') 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(lock_id)) { -- cgit v1.2.3