diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 6b0c14eac6f2..33afe3c9ebb5 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -183,15 +183,15 @@ void Initialize(ThreadState *thr) { ctx->dead_list_tail = 0; InitializeFlags(&ctx->flags, env); InitializeSuppressions(); - InitializeMemoryProfile(); - InitializeMemoryFlush(); - #ifndef TSAN_GO + // Initialize external symbolizer before internal threads are started. const char *external_symbolizer = flags()->external_symbolizer_path; if (external_symbolizer != 0 && external_symbolizer[0] != '\0') { InitializeExternalSymbolizer(external_symbolizer); } #endif + InitializeMemoryProfile(); + InitializeMemoryFlush(); if (ctx->flags.verbosity) TsanPrintf("***** Running under ThreadSanitizer v2 (pid %d) *****\n",