[compiler-rt] r204043 - [sanitizer] reverse the order of the stack traces printed for every pair of locks in the deadlock report (first print the 'from' node, then print the 'to' node of the deadlock graph)

Kostya Serebryany kcc at google.com
Mon Mar 17 07:56:04 PDT 2014


Author: kcc
Date: Mon Mar 17 09:56:04 2014
New Revision: 204043

URL: http://llvm.org/viewvc/llvm-project?rev=204043&view=rev
Log:
[sanitizer] reverse the order of the stack traces printed for every pair of locks in the deadlock report (first print the 'from' node, then print the 'to' node of the deadlock graph)

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
    compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h?rev=204043&r1=204042&r2=204043&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h Mon Mar 17 09:56:04 2014
@@ -231,8 +231,8 @@ class DeadlockDetector {
                                      added_edges, ARRAY_SIZE(added_edges));
     for (uptr i = 0; i < n_added_edges; i++) {
       if (n_edges_ < ARRAY_SIZE(edges_))
-        edges_[n_edges_++] = Edge((u16)added_edges[i], (u16)cur_idx, stk,
-                                  dtls->findLockContext(added_edges[i]));
+        edges_[n_edges_++] = Edge((u16)added_edges[i], (u16)cur_idx,
+                                  dtls->findLockContext(added_edges[i]), stk);
       // Printf("Edge [%zd]: %u %zd=>%zd\n", i, stk, added_edges[i], cur_idx);
     }
     return n_added_edges;

Modified: compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc?rev=204043&r1=204042&r2=204043&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc Mon Mar 17 09:56:04 2014
@@ -417,13 +417,13 @@ class LockTest {
     fprintf(stderr, "Starting Test16: detailed output test with two locks\n");
     // CHECK: Starting Test16
     // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
-    // CHECK: LockTest::Acquire1
-    // CHECK-NEXT: LockTest::Acquire_0_then_1
     // CHECK: LockTest::Acquire0
     // CHECK-NEXT: LockTest::Acquire_0_then_1
-    // CHECK: LockTest::Acquire0
-    // CHECK-NEXT: LockTest::Acquire_1_then_0
     // CHECK: LockTest::Acquire1
+    // CHECK-NEXT: LockTest::Acquire_0_then_1
+    // CHECK: LockTest::Acquire1
+    // CHECK-NEXT: LockTest::Acquire_1_then_0
+    // CHECK: LockTest::Acquire0
     // CHECK-NEXT: LockTest::Acquire_1_then_0
     Init(5);
     Acquire_0_then_1();





More information about the llvm-commits mailing list