~/talk

Fantastic C++ Bugs and How to Test Them

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [testing]
links:none on file
slides:none on file

Shows a concrete pcap included length bug where rewritten padding desynchronizes readers and is fixed with two code lines but protected by 150 lines of tests that reproduce write/read behavior. Demonstrates an NFS-only failure of renameat2 and a tempdir workaround, a sigbus from truncated mmap reproduced with 100-thread interleaving, a lazy-init use-after-free from double-checked locking exercised with a release-barrier of threads, and tests using LocalStack S3, dup/pipe stderr capture, and synthetic-throwing condition variables to prove strong exception safety.

AI-written summary · about

  1. 0:00Unit tests beyond rules
  2. 1:27Pcap file bug origin
  3. 5:14One line needs 150 tests
  4. 8:26Unit tests systematize knowledge
  5. 10:12Testing versus unit testing
  6. 11:56Unit tests boost productivity
  7. 13:20Safe file system testing
  8. 15:26NFS rename bug isolation
  9. 17:53Fix bugs by making code testable
  10. 20:46Sigbus bug from truncation
  11. 24:59TOCTOU bugs and races
  12. 27:04Double-checked locking UAF
  13. 32:24Spurious wakeups in queues
  14. 36:35Legacy component cascading bugs
  15. 38:00Testing exception safety
  16. 41:11Testing networked apps
  17. 44:46Mocking global resources
  18. 49:19Trivial functions can have bugs
  19. 51:02Why write unit tests
~/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.