[PATCH] D20427: [tsan] Don't abort when a deadlock detector finds a mutex cycle longer than 10

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 05:58:09 PDT 2016


kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, kcc, glider, samsonov.
kubabrecka added subscribers: llvm-commits, zaks.anna, dcoughlin.
kubabrecka added a project: Sanitizers.
Herald added a subscriber: kubabrecka.

In one of the already existing apps that I'm testing TSan on, I really see a mutex path that is longer than 10 (but not by much, something like 11-13 actually).  Let's weaken the assertion and simply not report this deadlock.

http://reviews.llvm.org/D20427

Files:
  lib/sanitizer_common/sanitizer_deadlock_detector1.cc

Index: lib/sanitizer_common/sanitizer_deadlock_detector1.cc
===================================================================
--- lib/sanitizer_common/sanitizer_deadlock_detector1.cc
+++ lib/sanitizer_common/sanitizer_deadlock_detector1.cc
@@ -121,7 +121,10 @@
   DDLogicalThread *lt = cb->lt;
   uptr path[10];
   uptr len = dd.findPathToLock(&lt->dd, m->id, path, ARRAY_SIZE(path));
-  CHECK_GT(len, 0U);  // Hm.. cycle of 10 locks? I'd like to see that.
+  if (len == 0U) {
+    // Hm.. cycle of 10 locks? I'd like to see that.
+    return;
+  }
   CHECK_EQ(m->id, path[0]);
   lt->report_pending = true;
   DDReport *rep = &lt->rep;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20427.57773.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160519/af55196d/attachment.bin>


More information about the llvm-commits mailing list