Advanced · Module 9 · Lesson 4 of 13
Memory and Concurrency Sanitizers: ASan, UBSan, TSan, and Valgrind Massif
Detect memory corruption with AddressSanitizer shadow memory, catch undefined behavior with UBSan, trace data races with ThreadSanitizer, and profile heap peaks using Valgrind Massif.
By the end you can
- Inspect memory corruption and use-after-free defects using AddressSanitizer shadow byte tracking
- Catch integer overflows, null dereferences, and misalignment traps with UndefinedBehaviorSanitizer
- Diagnose multi-threaded data races and missing synchronization with ThreadSanitizer vector clocks
- Profile dynamic heap consumption peaks and allocation graphs using Valgrind Massif
Builds on Dynamic System Call and Userspace Tracing: strace, ltrace, and kprobes.
01 · A question first
Why can a heap buffer overflow silently overwrite neighboring variables for months without crashing, only to take down a production server under heavy load? And how do sanitizers catch these latent bugs at the exact instruction they occur with zero false positives?
Make a guess before you read on.
02 · The idea
Members only
Unlock the full lesson
This lesson is part of the membership. Join to read it in full, along with every other premium deep dive.
What's inside
- Start with the problem
- How the idea works
- Production Workflows and Compilation Flags
- What it costs
- Pitfalls and variations
- Where it is used
03 · Practice
Asked in interviews
Something wrong with this lesson? Report a problem