GDB for Multi-threaded C: Hunting Race Conditions Without Losing Your Mind
Multi-threaded bugs vanish under the debugger. Stack traces lie. Variables seem to change value between two prints. The GDB techniques that actually find races: thread-pinned breakpoints, non-stop mode, watchpoints, TSan-then-GDB, and rr.