Debugging data races
summary
Covers concrete root causes (load/store reordering, missing memory barriers, double-check and double-read races) and fixes (volatile/atomics, ordering on both sides). Shows practical tools and tradeoffs: findbugs for pattern matches, heavy tools that incur 10x slowdown, and model checking for small critical algorithms. Describes a working ring-buffer per-thread logging + nanotime post-sort used to reproduce races (used on H2O clustering) and a repeat-until statistical testing strategy to measure and drive down rare failure rates.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:52A Short Debugging Tale
- 1:58What IS a Data Race?
- 2:44Timeline of a Data Race
- 4:43Reordering Memory Ops
- 8:09Common Data Races
- 10:06Double Checked Locking
- 11:18More On Double-Read
- 13:01Getting Clever w/HashMap
- 16:13Debugging Techniques
- 17:33Visual Inspection
- 22:15The Cycle
- 24:32Cheaper "Printing"
- 26:22Printing Cheap "Printing"
- 27:25Tools
- 28:44Defensive Locking
- 30:20Other Techniques
- 31:48Testing Concurrent Code
- 36:17Code Reviews
- 37:22Static Analysis
- 38:08Unit Tests
- 39:45Unit Test Framework Issues
- 40:43White Box Testing
- 42:30Load Testing
- 45:57Statistical Testing
- 48:25Distributed App Testing
- 50:19Writing Data Races
- 52:55The Pitfall
related talks
22mData race detection
07mRace Conditions in Details
50mThe Hidden Art of Thread-Safe Programming: Exploring java.util.con...
19mRuntime Detection of Data Races in OCaml with ThreadSanitizer
23mDynamic Race Detection with O(1) Samples
21mWhat happens-after the first race? enhancing the predictive power of dynamic race detection
30mScreaming Zombies and Other Tales: Race Condition Woes
15mEnemy of the State, Understanding the Many Flavors of Race Conditions
