summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sanitizer_common/sanitizer_deadlock_detector1.cc1
-rw-r--r--test/tsan/deadlock_detector_stress_test.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_deadlock_detector1.cc b/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
index ba03e0d74..b692ee459 100644
--- a/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
+++ b/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
@@ -132,6 +132,7 @@ DDReport *DDetectorImpl::MutexUnlock(DDPhysicalThread *pt, DDLogicalThread *lt,
void DDetectorImpl::MutexDestroy(DDPhysicalThread *pt, DDLogicalThread *lt,
DDMutex *m) {
+ if (!m->id) return;
SpinMutexLock lk(&mtx);
if (dd.nodeBelongsToCurrentEpoch(m->id))
dd.removeNode(m->id);
diff --git a/test/tsan/deadlock_detector_stress_test.cc b/test/tsan/deadlock_detector_stress_test.cc
index c442d15be..6d9f4b8bd 100644
--- a/test/tsan/deadlock_detector_stress_test.cc
+++ b/test/tsan/deadlock_detector_stress_test.cc
@@ -495,7 +495,7 @@ int main(int argc, char **argv) {
LockTest().Test12();
LockTest().Test13();
LockTest().Test14();
- // LockTest().Test15(); FIXME: this is broken for PthreadRWLock
+ // LockTest().Test15(); // FIXME: this is broken for PthreadRWLock
fprintf(stderr, "ALL-DONE\n");
// CHECK: ALL-DONE
}