[compiler-rt] [tsan] Don't symbolize stack traces if dl_iterate_phdr is not ready (PR #143199)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 14:02:00 PDT 2025


================
@@ -846,7 +846,16 @@ ALWAYS_INLINE USED void PrintCurrentStack(uptr pc, bool fast) {
     ptrace->trace_buffer[i] = ptrace->trace_buffer[ptrace->size - i - 1];
     ptrace->trace_buffer[ptrace->size - i - 1] = tmp;
   }
-  PrintStack(SymbolizeStack(*ptrace));
+
+  if (ready_to_symbolize) {
----------------
thurstond wrote:

In the Initialize function:
```
  ...
  InitializeInterceptors(); <- ready_to_symbolize set to true in the middle of here
  InitializePlatform();
  InitializeDynamicAnnotations();
#if !SANITIZER_GO
  InitializeShadowMemory();
  InitializeAllocatorLate();
  InstallDeadlySignalHandlers(TsanOnDeadlySignal);
#endif
  ...
  // Initialize thread 0.
  Tid tid = ThreadCreate(nullptr, 0, 0, true);
  CHECK_EQ(tid, kMainTid);
  ThreadStart(thr, tid, GetTid(), ThreadType::Regular);
```


https://github.com/llvm/llvm-project/pull/143199


More information about the llvm-commits mailing list