-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add add sanitizers to unit test cmake build #205
Conversation
jvishnefske
commented
Nov 1, 2022
•
edited
Loading
edited
- currently enabled on 64 bit unit test build. (edit: sanitizers added to x32 build by beaf0a8)
- silently falls back if -fsanitize=undefined support is not detected
- verifies bug-203 fix
I am attempting to build with and without including the FIX-204 to see if the issue shows up in the log. currently a sanitizer runtime warning does not cause the unit test to fail. |
I was able to get the cmake unit tests to fail from an actual undefined behavior on gcc.
the 32 bit version of the symbol needed to enable undefined sanitizer on clang appear to be avaliable as a static library on ubuntu docker. user@80a9238469f6:/usr/lib32$ grep -r __mulodi4 /usr |
Please tag me when ready for review. |
@pavel-kirienko the basic concept here seems to be working, and was able to fail on the #203 issue in my local tests. I considered adding support with toolchain files, however that would have been (possbily)even more invasive since the entire build matrix would have to be broken into several toolchain files. This implementation uses runtime compile checks to query the compiler for basic support, and then sets the resulting binary to fail if any of a list of checks are encountered. The disadvantage of this approach is that compilers which are new enough to support -fsanitize=undefined, but do not support one of the long list of "fatal" checks may have compile errors. since the cmake build is recomended to only be used for unit tests. I don't know if this is a disadvantage for any use case. |