https://github.com/google/sanitizers/wiki
https://github.com/google/sanitizers/wiki/AddressSanitizer
AddressSanitizer (aka ASan) is a memory error detector for C/C++. It finds:
- Use after free (dangling pointer dereference)
- Heap buffer overflow
- Stack buffer overflow
- Global buffer overflow
- Use after return
- Use after scope
- Initialization order bugs
- Memory leaks
This tool is very fast. The average slowdown of the instrumented program is ~2x (see AddressSanitizerPerformanceNumbers).
The tool consists of a compiler instrumentation module (currently, an LLVM pass) and a run-time library which replaces the malloc
function.
Powerful, easy to use, the default integrated into gcc 4.8;
Ease of integration, the use of only some of clang + In Flag, but also can do filtering: leakage of known function e.g.
Performance is also good, but the source of the 2 × occupied, much better compared valgrind;
Can be used with gdb / objdump -ldS;