~/talk

How to debug Linux multi threaded code

Talkat Meeting C++ 2024 · 2024-11-14..11-16· [devops-and-delivery]
name:Greg Law
linkedin:gregthelaw
slides:none on file

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

  1. 0:00Debugging race conditions
  2. 2:04What makes bugs hard to find
  3. 4:14Race conditions are tricky
  4. 7:05Debugging tools
  5. 9:37Demo with ThreadSanitizer
  6. 13:54Sanitizers vs Valgrind
  7. 16:05Race conditions in action
  8. 19:23False positives in tools
  9. 24:01Data races vs race conditions
  10. 26:55Debugging with GDB
  11. 37:10GDB thread scheduling
  12. 44:20ThreadSanitizer sync issues
  13. 45:26Logging for race conditions
  14. 51:42L3 logging avoids sync
  15. 56:59Thread fuzzing
  16. 1:01:37Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.