liboqs
liboqs copied to clipboard
Run clang's MemorySanitizer in CI
In compiler_opts.cmake, we have the following code:
elseif(USE_SANITIZER STREQUAL "Memory")
add_compile_options(-fsanitize=address)
set(SANITIZER_LD_FLAGS "-fsanitize=memory")
elseif(USE_SANITIZER STREQUAL "MemoryWithOrigins")
...
I opened this issue to ask whether we should be running a memory-sanitizer build regularly to test this option.
Your point is that it should be add_compile_options(-fsanitize=memory)? Yes, let's fix that.
As for running it regularly in CI, sure, if the runtime is not problematic.
I tried running the tests with the memory sanitizer turned on after creating #1680. The build was intensive, and the tests failed very loudly. Interestingly enough there were quite a few complaints about functions in libcrypto, so some of the failures might be beyond our control. (That said, the tests also failed loudly with -DOQS_USE_OPENSSL=OFF.)
#1680 contains the one-line fix for the compile flag, so I'm going to preemptively rename this issue to clarify that it's tracking the proposed CI configuration. However, I think it will be a significant amount of work to get the memory sanitizer working in CI.