diff options
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.cc')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index db35a68ba64..5a7a57efcd9 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -91,7 +91,7 @@ ThreadState::ThreadState(Context *ctx, int tid, int unique_id, u64 epoch, // Do not touch these, rely on zero initialization, // they may be accessed before the ctor. // , ignore_reads_and_writes() - // , in_rtl() + // , ignore_interceptors() #ifndef TSAN_GO , jmp_bufs(MBlockJmpBuf) #endif @@ -116,8 +116,9 @@ static void MemoryProfiler(Context *ctx, fd_t fd, int i) { } static void BackgroundThread(void *arg) { - ScopedInRtl in_rtl; Context *ctx = CTX(); + // This is a non-initialized non-user thread, nothing to see here. + ScopedIgnoreInterceptors ignore; const u64 kMs2Ns = 1000 * 1000; fd_t mprof_fd = kInvalidFd; @@ -216,11 +217,12 @@ void Initialize(ThreadState *thr) { if (is_initialized) return; is_initialized = true; + // We are not ready to handle interceptors yet. + ScopedIgnoreInterceptors ignore; SanitizerToolName = "ThreadSanitizer"; // Install tool-specific callbacks in sanitizer_common. SetCheckFailedCallback(TsanCheckFailed); - ScopedInRtl in_rtl; #ifndef TSAN_GO InitializeAllocator(); #endif @@ -261,7 +263,6 @@ void Initialize(ThreadState *thr) { int tid = ThreadCreate(thr, 0, 0, true); CHECK_EQ(tid, 0); ThreadStart(thr, tid, internal_getpid()); - CHECK_EQ(thr->in_rtl, 1); ctx->initialized = true; if (flags()->stop_on_start) { @@ -273,7 +274,6 @@ void Initialize(ThreadState *thr) { } int Finalize(ThreadState *thr) { - ScopedInRtl in_rtl; Context *ctx = __tsan::ctx; bool failed = false; @@ -340,7 +340,6 @@ u32 CurrentStackId(ThreadState *thr, uptr pc) { void TraceSwitch(ThreadState *thr) { thr->nomalloc++; - ScopedInRtl in_rtl; Trace *thr_trace = ThreadTrace(thr->tid); Lock l(&thr_trace->mtx); unsigned trace = (thr->fast_state.epoch() / kTracePartSize) % TraceParts(); @@ -657,7 +656,6 @@ void MemoryRangeImitateWrite(ThreadState *thr, uptr pc, uptr addr, uptr size) { ALWAYS_INLINE USED void FuncEntry(ThreadState *thr, uptr pc) { - DCHECK_EQ(thr->in_rtl, 0); StatInc(thr, StatFuncEnter); DPrintf2("#%d: FuncEntry %p\n", (int)thr->fast_state.tid(), (void*)pc); thr->fast_state.IncrementEpoch(); @@ -687,7 +685,6 @@ void FuncEntry(ThreadState *thr, uptr pc) { ALWAYS_INLINE USED void FuncExit(ThreadState *thr) { - DCHECK_EQ(thr->in_rtl, 0); StatInc(thr, StatFuncExit); DPrintf2("#%d: FuncExit\n", (int)thr->fast_state.tid()); thr->fast_state.IncrementEpoch(); |

