Debugging memory corruptions in C++
summary
Covers concrete bug classes — buffer overflows, use‑after‑free, SSO and string_view null termination traps, moved‑from objects and missing special member functions, and how new/delete operator overloads can redirect allocation paths — and how hardware cache and alignment bite back. Uses compiler flags (-Wall -Wextra), static analyzers, runtime sanitizers like ASan, Valgrind and GWP‑ASan, Microsoft user/driver tools, and demonstrates a homemade stack‑smashing detector plus memory pooling (PMR) approaches with working examples and tradeoffs.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:46Memory corruptions and causes
- 3:53Stack structure and overflow risks
- 5:20C++ dark corners
- 7:34Implementation-defined traps
- 10:08String handling pitfalls
- 12:06Compiler constructors and rule of zero
- 13:58Overriding delete operators
- 16:10Hardware memory traps
- 19:00Preventing memory corruptions
- 23:06Static analyzers and flags
- 25:38Compiler warnings and annotations
- 27:55Sanitizers for runtime errors
- 30:48Advanced sanitizers and tools
- 32:42Manual detection techniques
- 35:16Stack smashing detection
- 39:43Code review and collaboration
- 41:57Q&A
related talks
01h 06mSecurity Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design
01h 00m“Secure Coding Best Practices: Your First Line Is The Last Line Of Defense (1 of 2)”
01h 06mmemory-safe C++
01h 00mExceptional C++
01h 00mSanitize for your Sanity: Sanitizers tools for Modern C++
01h 04mCompiler Bugs And Bug Compilers
43mEverything I learned about static analysis and program safety in C++
54mCatching Real-time Safety Violations in C++
