Closed BenWibking closed 3 months ago
I'm asking wrt to whether it's worth to activate this by default to one of the short or extended tests (once the issue reported in #1107 are fixed).
I definitely support having it run on one of the extended tests (unless it takes hours to run with these options on).
Running the test suite with this turned on is only about a factor of 2-3 slower on my laptop, so I think it should be fine to enable for the extended CI.
PR Summary
Add CMake options
ENABLE_ASAN
andENABLE_HWASAN
to build with AddressSanitizer and HWAddressSanitizer, respectively, turned on.ASAN is supported in both clang and gcc. HWASAN is support by clang and (in theory) gcc.
Then the app is run as normal. It will stop and print an error if a memory bug is detected. This should detect almost all out of bounds access, uninitalized values, and other memory errors for CPU builds.
Usage notes:
Miscellaneous useful env vars to configure its behavior when running:
HWAddressSanitizer only works on Linux ARM platforms but runs significantly faster than AddressSanitizer. In my testing, additional flags are required for HWAsan:
(I was not able to get it working with gcc, since building HWASAN support in gcc is optional and distros don't do it.)
PR Checklist