Reactivate Clang UBSan test coverage by StephanTLavavej · Pull Request #5746 · microsoft/STL (original) (raw)

Fixes #3568.

This was briefly enabled for Clang 15 by #3452 on 2023-03-13, then disabled for Clang 16 by #3711 on 2023-05-18. After updating to Clang 20 by #5717 on 2025-09-15, we can re-enable this test coverage.

Note that tests/utils/stl/test/features.py disabled the configurations. We accumulated a couple of changes to tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst and tests/std/tests/usual_matrix.lst commenting out configurations, but I believe those changes were unnecessary. This PR updates features.py to enable the feature, uncomments the commented-out configurations, and doesn't change the large number of already-uncommented configurations across other files.

I audited our env.lst and related files, and I believe our UBSan coverage is reasonably comprehensive now. For the tests it's missing from, they either have good reasons (e.g. compile-only, /clr specific, incompatible with Clang for other reasons, etc.) or already have a blizzard of configurations where UBSan wouldn't be worth the extra cost.

Notably, UBSan has never been enabled for libcxx, and I am not attempting to do so here. libcxx configurations are extremely expensive (that's why we have only three). It may be reasonable to explore this in the future, but I don't want to spend developer and machine time on that now.

I'll leave Clang UBSan disabled for the MSVC-internal test harness (this was src/qa/VC/shared/testenv/bin/run.pl in MSVC-PR-457627, for future reference). I don't know if it works now, but it would provide negative value by burning a lot of machine time when GitHub is providing sufficient coverage of the STL's product and test code.

We've already merged a couple of fixes for bugs in vector<bool> and independent_bits_engine found by this impending PR:

⚙️ Commits