How to debug Linux multi threaded code
summary
Shows concrete debugging steps: compile with ThreadSanitizer to get a line‑accurate race (demo program returns 0 or 1 and TSan points to line 9 vs line 10), compare with slower binary tools like Helgrind/Valgrind, use GDB scheduler‑locking and thread‑named backtraces to find which thread holds a lock, install a lightweight L3 logger (≈1 ns single‑thread, ≈7 ns with atomic index) instead of printf, and create a LiveRecorder plus time travel debugging + thread‑fuzzing workflow that turns an hour‑rare heisenbug into a fast, reproducible failure.
AI-written summary · about
chapters (16)
- 0:00Debugging race conditions
- 2:04What makes bugs hard to find
- 4:14Race conditions are tricky
- 7:05Debugging tools
- 9:37Demo with ThreadSanitizer
- 13:54Sanitizers vs Valgrind
- 16:05Race conditions in action
- 19:23False positives in tools
- 24:01Data races vs race conditions
- 26:55Debugging with GDB
- 37:10GDB thread scheduling
- 44:20ThreadSanitizer sync issues
- 45:26Logging for race conditions
- 51:42L3 logging avoids sync
- 56:59Thread fuzzing
- 1:01:37Q&A
related talks
01h 00mInvestigating C++ Applications in Production on Linux and Windows
42mWhen the OS gets in the way
52mApplication-Level Debugging and Profiling: Gaps in the Tool Ecosystem
01h 29mMore GDB wizardry and 8 other essential Linux application debugging tools
01h 05mThe art and methodology of troubleshooting
01h 01mDebugging and Profiling .NET Core Apps on Linux
54mStrace - Swiss Army Knife to Trace, Analyze, RT Debug
37mKernel and userspace tracing with LTTng and friends
