~/talk

Back To Basics: Undefined Behavior

Talkat CppCon 2021 · on Wednesday, 2021-10-27· at 09:00· online· [security]
links:none on file
links:none on file
slides:none on file

Builds a precise definition of undefined behavior, then shows concrete, surprising instances: an infinite loop with no side effects that is UB, signed integer overflow in a cube function, UB that collapses a for loop by indexing past the end, and UB that happens at compile time by specializing a std trait. Recommends tools and fixes: sanitizers including undefined behavior sanitizer, different compilers, std::bit_cast/memcpy for type punning, and treats UB as a critical, non-recoverable bug.

AI-written summary · about

  1. 0:00Start
  2. 0:56Definitions
  3. 1:54Introduction
  4. 5:30Correct Program Must Be Free of Undefined Behavior
  5. 10:21Undefined Behavior
  6. 14:23Defined Behavior
  7. 15:12Implementation Defined Behavior
  8. 15:44Unspecified Behavior
  9. 26:54How Is Undefined Behavior Defined
  10. 28:28More Common Undefined Behaviors
  11. 31:10Infinite Loop without Side Effects
  12. 32:42Signed Integer Overflow
  13. 35:56Is Undefined Behavior Acceptable
  14. 40:29Testing for Undefined Behavior
  15. 45:18Example with no Return Statement
  16. 58:56Treat Undefined Behavior as a Critical Bug
~/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.