diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-09-02 11:23:39 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2012-09-02 11:23:39 +0000 |
commit | 0542644830da123babea42f58416487be467c72d (patch) | |
tree | 7f23c576026253d065209bc981fa4d2fbeef6d98 | |
parent | 1da1056127d1dbcacdd035eb4149257848f7c4df (diff) |
tsan: more robust current thread stack restoration
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163089 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/tsan/rtl/tsan_rtl_report.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/tsan/rtl/tsan_rtl_report.cc b/lib/tsan/rtl/tsan_rtl_report.cc index 0015c4bae..39ad2f9d3 100644 --- a/lib/tsan/rtl/tsan_rtl_report.cc +++ b/lib/tsan/rtl/tsan_rtl_report.cc @@ -399,6 +399,11 @@ void ReportRace(ThreadState *thr) { 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 @@ void ReportRace(ThreadState *thr) { 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()]; |