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.
Apply the patches attached to this page.
Make sure you've run tools/clang/scripts/update.sh (see https://code.google.com/p/chromium/wiki/Clang for details).
Note that the above flags require that protobuf library is installed in the system. For Ubuntu, this can be done with
MSan requires 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:
All MSan reports can be suppressed by passing extra compilation flags
and running with extra environment
This can be used to benchmark compiler-only tool without MSanDR.
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):