Compiler Sanitizers for Fun and Profit
summary
Enables the thread sanitizer in Xcode or via -fsanitize=thread and the compiler injects runtime checks (IR-level calls like TSan_read8/TSan_write8) before every memory access; TSan records thread, caller PC, address and size, keeps a recent-access buffer, and reports a data race when the same address is accessed by different threads with at least one write. It runs only on 64-bit simulator (not device), costs ~2–20× CPU and ~5–10× memory, and can warn about races that haven’t yet manifested.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:40Practical Parts
- 3:04Problem Statement
- 6:26Threat Sanitizer
- 8:58Thread Sanitizer
- 12:14Testing
- 15:08Sanitizer Parameters
- 16:04Race Conditions
- 17:21Uncertainty
- 18:19Thread Sanitizers
- 19:53Troubleshooting
- 21:51Collect the right data
- 22:45Go one more level down
related talks
01h 03mReal-time Safety — Guaranteed by the Compiler!
18mExciting new compiler flags for kernel security
18mDon't Look UB: Exposing Sanitizer-Eliding Compiler Optimizations
52mTrust No Input: Taint Analysis at Compile Time
51mSwift 2 Under the Hood
01h 04mC++ Insights: Peek behind the curtains of your C++ compiler
09mRustc: How I Learned to Respect the Compiler
01h 02mMemory and Compilers
