Address Sanitizer - AshokBhat/notes GitHub Wiki

About

LLVM AddressSanitizer

  • Fast memory error detector
  • Consists of a compiler instrumentation module and a run-time library

Features

Tool can detect the following types of bugs:

  • Out-of-bounds accesses to heap, stack and globals
  • Use-after-free
  • Use-after-return (runtime flag ASAN_OPTIONS=detect_stack_use_after_return=1)
  • Use-after-scope (clang flag -fsanitize-address-use-after-scope)
  • Double-free, invalid free
  • Memory leaks (experimental)

Performance

  • Typical slowdown introduced by AddressSanitizer is 2x.

See also