Index: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc =================================================================== --- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc +++ compiler-rt/trunk/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(); } }