MemorySanitizer (MSan) is a detector of uninitialized reads based on compiler instrumentation (LLVM).
It is EXPERIMENTAL. The only supported platform is Linux64.
Additional info on the tool itself is available at http://clang.llvm.org/docs/MemorySanitizer.html. Some information is available from MSan wiki.
MSan is currently undergoing Chromium deployment. We have an experimental bot running at http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20MSan
This is how we currently build:
Run the resulting binaries as usual. Be sure to have
WARNING: the information below may be out of date.
MSan can be used with a helper tool called MSanDR to avoid false positives from uninstrumented system libraries.
Add the following to custom_deps section of .gclient:
Run the tests:
Native_exec is a special mode of MSanDR where compiler-instrumented modules are not dynamically translated. Instead DR transfers control to compiler-instrumented code directly, patches PLT entries and expects some help from the compiler to catch returns via indirect jumps.
Some information on this mode is available at https://code.google.com/p/memory-sanitizer/wiki/MSanDR
A hacky way to build unit tests with native_exec support is with the following CFLAGS (change /code/llvm to your path to the msandr client):