Garbage In, Garbage Out: Arguing about Undefined Behavior...
summary
Argues that undefined behavior is a symptom not the root problem and proposes treating language features as either narrow vs wide contracts with concrete principles: a narrow contract must be checkable, provide significant value, be explainable, and not break long‑standing code. Shows concrete examples (null dereference, signed left shifts, unsigned wrap causing allocation bugs in SPEC, a Bzip inner loop where signed vs unsigned changes 2x performance), points to Android and WebAssembly tradeoffs and recommends targeted runtime/static checks rather than blanket redefinition.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 5:30Undefined Behavior
- 8:10Programming Errors
- 11:30Symptoms of Undefined Behavior
- 12:37Wide vs Narrow Contracts
- 15:07What can we do
- 16:30Can we define all behaviors
- 17:25What are the tradeoffs
- 17:42Can we constrain undefined behavior
- 18:12This isnt about undefined behavior
- 18:41The wishywashy thing
- 19:30Narrow contracts
- 20:37Programming error
- 21:13Principles
- 24:25Examples
- 27:48Complicated Example
- 33:14Spec Example
- 39:17Optimization Example
- 44:07Questions
related talks
54mUndefined Behaviour is awesome!
49mUndefined Behavior in 2017 (part 1 of 2)
13mUndefined, Unspecified, Non-deterministic, and Implementation Defined Behavior
22mCompilers should get over themselves and respect semantic dependencies!
01h 11mProgramming language memory models: Problems, solutions, and directions
49m“Which Machine Am I Coding To?”
19mExploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the(…)
50mThe Post JavaScript Apocalypse
