This introduces an abstraction layer src/checkmem.h
, which defines macros for interacting with memory checking tools. Depending on the environment, they’re mapped to MemorySanitizer builtins, Valgrind integration macros, or nothing at all.
This means that msan builds immediately benefit from existing undefined memory checks in the tests. It also means those builds result in a ctime_tests
(new name for valgrind_ctime_test
) binary that can usefully test constant-timeness (not inside Valgrind, and with the downside that it’s not running against a production library build, but it’s faster and available on more platforms).
Such an msan-ctime test is added to the Linux x86_64 msan CI job, as an example. More CI cases could be added (e.g. for MacOs or ARM Linux) later.