In MSVC, the following sanitizer options are available ( /fsanitize (Enable sanitizers) | Microsoft Learn) :
/fsanitize=address/fsanitize=kernel-address/fsanitize=fuzzer/fsanitize-address-use-after-returnrequiresset ASAN_OPTIONS=detect_stack_use_after_return=1
With Clang ( AddressSanitizer — Clang 23.0.0git documentation):
- -fsanitize=realtime, requires marking checked functions with [[clang::nonblocking]]
-fsanitize=type- -fsanitize=undefined
-fsanitize=memory-fsanitize=thread- -fsanitize=address,
export ASAN_OPTIONS=detect_leaks=1to enable on all platforms
All of the above-mentions options can be combined with -fsanitize-minimal-runtime to reduce runtime overhead
With GCC ( Instrumentation Options (Using the GNU Compiler Collection (GCC))):
- -fsanitize=undefined
- -fsanitize=leak XOR -fsanitize=thread
- -fsanitize=address XOR -fsanitize=thread
- -fsanitize=kernel-address (Linux specific)
- -fsanitize=hwaddress (AArch64 specific)
- -fsanitize=kernel-hwaddress (AArch64 and Linux only)
- -fsanitize=memtag-stack (AArch64 specific)
-fsanitize=pointer-compareand-fsanitize=pointer-subtracttogether with either -fsanitize=address or -fsanitize=kernel-address (enabled at runtime withexport ASAN_OPTIONS=detect_invalid_pointer_pairs=2)
A quick peruse of CI workflow files show that only ASan, TSan, and UBSan is enabled on Ubuntu 24.04 amd64 images. Should this coverage not be extended to all Tier 1 and Tier 2 platforms listed in PEP 11 – CPython platform support | peps.python.org?