To build with the sanitizer support use clang compiler and set CMAKE_BUILD_TYPE to "DebugSan". More info: http://clang.llvm.org/docs/AddressSanitizer.html.