Index: lib/tsan/rtl/tsan_interceptors.cc =================================================================== --- lib/tsan/rtl/tsan_interceptors.cc +++ lib/tsan/rtl/tsan_interceptors.cc @@ -1292,7 +1292,11 @@ SCOPED_INTERCEPTOR_RAW(pthread_once, o, f); if (o == 0 || f == 0) return EINVAL; - atomic_uint32_t *a = static_cast(o); + atomic_uint32_t *a; + if (!SANITIZER_MAC) + a = static_cast(o); + else // On OS X, pthread_once_t has a header with a long-sized signature. + a = static_cast((void *)((char *)o + sizeof(long))); u32 v = atomic_load(a, memory_order_acquire); if (v == 0 && atomic_compare_exchange_strong(a, &v, 1, memory_order_relaxed)) {