Add support for thread sanitizer (TSAN) via --with-thread-sanitizer
#112536
Labels
3.13
new features, bugs and security fixes
topic-free-threading
type-feature
A feature request or enhancement
Feature or enhancement
GCC and Clang provide ThreadSanitizer, a tool that detects data races. We should add support for thread sanitizer to CPython. Note that Python already supports the memory and address sanitizers.
--with-thread-sanitizeras a configure option_Py_THREAD_SANITIZERif thread-sanitizer is enabled (see, e.g.,_Py_ADDRESS_SANITIZERinpyport.h)_Py_NO_SANITIZE_THREADfromobmalloc.cto a place that's more widely available (likepyport.h). We're going to need this in a few placesEventually, it would be helpful to have a continuous build for the combination of
--disable-gil --with-thread-sanitizer. Note that we probably won't want to run all the tests. ThreadSanitizer is slow and also not very useful for single-threaded tests. We should collect a subset of our tests that use threading for the ThreadSanitizer continuous build.Linked PRs
The text was updated successfully, but these errors were encountered: