Build Using A Sanitizer

BDE build system supports sanitized builds for gcc and clang compilers with special UFID flags.

The UFID options related to sanitizers are:

UFID flag

Sanitizer

asan

Build with address sanitizer

msan

Build with memory sanitizer

tsan

Build with thread sanitizer

ubsan

Build with undefined behavior sanitizer

The main difficulty with sanitized build is the proper compiler deployment on the build host - some compilers require special versions of the compiler libraries to be available at link/run time.

Build with sanitizers

Make sure that compiler you use for instrumented build is installed with all necessary support for sanitizers

  • Clone the bde repository:

$ git clone https://github.com/bloomberg/bde.git
$ cd bde
  • Configure build with an address sanitizer:

$ eval `bbs_build_env -u dbg_asan_64_cpp17`
  • Build and run BDE tests:

$ bbs_build --target all.t --test run
  • Build and test as usual.