Index: lib/tsan/rtl/tsan_platform_mac.cc =================================================================== --- lib/tsan/rtl/tsan_platform_mac.cc +++ lib/tsan/rtl/tsan_platform_mac.cc @@ -139,7 +139,7 @@ } } else if (event == PTHREAD_INTROSPECTION_THREAD_DESTROY) { ThreadState *thr = cur_thread(); - if (thr->tctx->parent_tid == kInvalidTid) { + if (thr->tctx && thr->tctx->parent_tid == kInvalidTid) { DestroyThreadState(); } }