[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 08:29:49 PDT 2016
kubabrecka updated this revision to Diff 57800.
kubabrecka added a comment.
Updating patch.
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
@@ -119,9 +119,13 @@
void DD::ReportDeadlock(DDCallback *cb, DDMutex *m) {
DDLogicalThread *lt = cb->lt;
- uptr path[10];
+ uptr path[20];
uptr len = dd.findPathToLock(<->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) {
+ // A cycle of 20+ locks? Well, that's a bit odd...
+ Printf("WARNING: too long mutex cycle found\n");
+ return;
+ }
CHECK_EQ(m->id, path[0]);
lt->report_pending = true;
DDReport *rep = <->rep;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20427.57800.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160519/fd7ff6e3/attachment.bin>
More information about the llvm-commits
mailing list