Catching Memory Corruption with LLVM AddressSanitizer
Learn how LLVM's AddressSanitizer uses shadow memory and redzones to turn silent memory corruption into immediate, actionable crash reports in C/C++.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how LLVM's AddressSanitizer uses shadow memory and redzones to turn silent memory corruption into immediate, actionable crash reports in C/C++.
Intermittent crashes that move when you add a printf are heap corruption, not logic bugs. This guide shows how to catch the real culprit with AddressSanitizer in GCC and Clang: ordered checks, fixes matched to each report type, and when to escalate to Valgrind, UBSan, or TSan.
Diagnose LLVM AddressSanitizer false positives that appear only at -O2 or higher, with steps to distinguish optimization artifacts from real memory errors.