[llvm-dev] call_once and TSan

Kuba Brecka via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 1 05:30:25 PDT 2016


I'm trying to write a TSan interceptor for the C++11 call_once function.  There are currently false positive reports, because the inner __call_once function is located in the (non-instrumented) libcxx library, and on macOS we can't expect the users to build their own instrumented libcxx.

TSan already supports pthread_once and dispatch_once by having interceptors that re-implement the logic.  However, doing the same for call_once/__call_once doesn't work, because call_once is explicitly supposed to be exception-safe, but the sanitizer runtime libraries disallow exception handling.

Any ideas how to handle call_once in TSan?


More information about the llvm-dev mailing list