Guide agents through choosing, enabling, and interpreting compiler runtime sanitizers for finding memory errors, undefined behaviour, data races, and memory leaks.
| detectleaks=0/1 | Enable LeakSanitizer (default 1 on Linux) | | abortonerror=1 | Call abort() instead of exit() (for core dumps) | | logpath=path | Write report to file | | symbolize=1 | Symbolize addresses (needs llvm-symbolizer in PATH) | | fastunwindonmalloc=0 | More accurate stacks (slower) | | quarantinesizemb=256 | Delay reuse of freed memory |
Reading: the top frame in WRITE/READ is the access site; the allocated at stack shows the allocation. The region is 40 bytes at [start, end) and the access is at end = one byte past the end (classic off-by-one).
Compiler sanitizer skill for runtime bug detection in C/C++. Use when enabling and interpreting AddressSanitizer (ASan), UndefinedBehaviorSanitizer (UBSan), ThreadSanitizer (TSan), MemorySanitizer (MSan), or LeakSanitizer (LSan) with GCC or Clang. Activates on queries about sanitizer flags, sanitizer reports, ASAN_OPTIONS, memory errors, data races, undefined behaviour, uninitialised reads, or choosing which sanitizer to use for a given bug class. Source: mohitmishra786/low-level-dev-skills.