A Practical and Interactive Guide to Debugging C++ Code
summary
Crash reports go to a backend that groups by build and line so rare faults surface; reproducibility improves with AddressSanitizer ThreadSanitizer UBSan and targeted stress tests. Real bugs shown: a condition_variable notify outside the mutex causes destruction-and-crash (seen once every few weeks), a shared-memory size calculation doubles a vector when 32-bit and 64-bit processes mix, and ARM disassembly exposes a 3-bit shift bug (returns 2 of 4 items) from a long/int porting error. Use tracing and data breakpoints and tracing breakpoints, and record-and-replay like rr and UndoDB reverse debugging to find root causes and add guards or API-level fixes.
AI-written summary · about
chapters (11)
- 0:00Introduction to debugging
- 7:27Handling bug reports
- 12:47Debugging as iterative process
- 13:28Reproducing bugs reliably
- 22:38Locating the root cause
- 29:26Advanced debugging tools
- 34:22Questioning assumptions
- 35:05Fixing bugs effectively
- 41:09Preventing future bugs
- 47:24Testing and validation
- 48:08Q&A and closing
