[llvm-commits] [compiler-rt] r163089 - /compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc

Dmitry Vyukov dvyukov at google.com
Sun Sep 2 04:23:39 PDT 2012


Author: dvyukov
Date: Sun Sep  2 06:23:39 2012
New Revision: 163089

URL: http://llvm.org/viewvc/llvm-project?rev=163089&view=rev
Log:
tsan: more robust current thread stack restoration

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc?rev=163089&r1=163088&r2=163089&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc Sun Sep  2 06:23:39 2012
@@ -399,6 +399,11 @@
     Shadow s(thr->racy_state[i]);
     RestoreStack(s.tid(), s.epoch(), &traces[i]);
   }
+  // Failure to restore stack of the current thread
+  // was observed on free() interceptor called from pthread.
+  // Just get the current shadow stack instead.
+  if (traces[0].IsEmpty())
+    traces[0].ObtainCurrent(thr, 0);
 
   if (HandleRacyStacks(thr, traces, addr_min, addr_max))
     return;
@@ -408,9 +413,6 @@
     rep.AddMemoryAccess(addr, s, &traces[i]);
   }
 
-  // Ensure that we have at least something for the current thread.
-  DCHECK_EQ(traces[0].IsEmpty(), false);
-
   for (uptr i = 0; i < kMop; i++) {
     FastState s(thr->racy_state[i]);
     ThreadContext *tctx = ctx->threads[s.tid()];





More information about the llvm-commits mailing list