Disable rust when sanitizers are active#20
Disable rust when sanitizers are active#20emmatyping wants to merge 2 commits into3.15-rust-in-cpythonfrom
Conversation
In a follow up, we should enable sanitizers using nightly and the unstable sanitizers support, which works with all CPython sanitizers except undefined-behavior sanitizer. Unstable sanitizers support: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html
|
ASAN should be ok with only some code compiled under it -- MSAN requires everything to be compiled with it though. I don't know the other sanitizers by hand. |
|
@alex Interesting! Looking through the clang docs, it looks like only msan requires the entire binary to be instrumented (which makes sense). It looks like tsan and ubsan both cause issues with the bindings generation, so I'll allow Rust to build with asan, we can work on enabling the others in a follow up. |
|
Example of failed tsan run: https://github.com/Rust-for-CPython/cpython/actions/runs/20551830853/job/59030589093?pr=17 Example of failed ubsan run: https://github.com/Rust-for-CPython/cpython/actions/runs/20551830853/job/59030589072?pr=17 |
|
I've read up a fair bit more about this. I'm going to close this and open a new PR as a follow up to #24. My current plan is:
I think it is best to disable Rust for now since e.g. tsan can have false positives if not all of the code is instrumented. |
In a follow up, we should enable sanitizers using nightly and the unstable sanitizers support, which works with all CPython sanitizers except undefined-behavior sanitizer.
Unstable sanitizers support: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html