Greater sanitizer support in CI?

In MSVC, the following sanitizer options are available ( /fsanitize (Enable sanitizers) | Microsoft Learn) :

  • /fsanitize=address
  • /fsanitize=kernel-address
  • /fsanitize=fuzzer
  • /fsanitize-address-use-after-return requires set 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=1 to 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-compare and -fsanitize=pointer-subtract together with either -fsanitize=address or -fsanitize=kernel-address (enabled at runtime with export 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?

CI already takes an annoyingly amount of time and considerable gh resources.

I believe CI only covers Tier 1. Tier 2 is covered by buildbots, which might include some sanitizer runs – you could check. Adding Tier 2 to CI should then double CI time.

Adding sanitizer should then multiply CI time by an additional 4, or 8 total.