summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2014-12-22 12:32:52 +0000
committerDmitry Vyukov <dvyukov@google.com>2014-12-22 12:32:52 +0000
commitc1a04162ba272cc8b9b887383e278b819c555cb6 (patch)
tree0b9532b9825c06bca3ab9e9b2ef682381f57c68c /compiler-rt/lib
parent8f9911b571e3add31a0570c9b3520f45b9bc64b1 (diff)
downloadbcm5719-llvm-c1a04162ba272cc8b9b887383e278b819c555cb6.tar.gz
bcm5719-llvm-c1a04162ba272cc8b9b887383e278b819c555cb6.zip
tsan: reset stack0 in the first partition of thread trace
stack0/mset0 contained bogus values from the previous thread that used the same id llvm-svn: 224702
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
index 7b7b27c024f..d84cd44b554 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
@@ -116,7 +116,10 @@ void ThreadContext::OnStarted(void *arg) {
thr->fast_state.SetHistorySize(flags()->history_size);
const uptr trace = (epoch0 / kTracePartSize) % TraceParts();
Trace *thr_trace = ThreadTrace(thr->tid);
- thr_trace->headers[trace].epoch0 = epoch0;
+ TraceHeader *hdr = &thr_trace->headers[trace];
+ hdr->epoch0 = epoch0;
+ ObtainCurrentStack(thr, 0, &hdr->stack0);
+ hdr->mset0 = thr->mset;
StatInc(thr, StatSyncAcquire);
sync.Reset(&thr->clock_cache);
DPrintf("#%d: ThreadStart epoch=%zu stk_addr=%zx stk_size=%zx "
OpenPOWER on IntegriCloud