Skip to main content
← All terms
Glossary

AddressSanitizer (ASan)

A fast memory-error detector that catches heap/stack buffer overflows, use-after-free, and similar bugs at runtime.

AddressSanitizer (ASan) is a compile-time instrumentation tool built into LLVM and GCC that detects memory-safety errors at runtime with roughly 2x overhead. It works by replacing malloc/free with poisoned shadow memory: every allocated object is surrounded by redzone bytes, and all memory accesses are checked against the shadow map. Detected errors include heap-buffer-overflow, stack-buffer-overflow, use-after-free, use-after-return, use-after-scope, and double-free. In fuzzing, ASan is the standard companion to a coverage-guided fuzzer: it converts silent memory corruption into loud, symbolized crash reports. Without ASan, a buffer overflow that doesn't crash immediately may go undetected; with AsAN, it terminates the process with a precise error report including the allocation stack, free stack, and access address.