Undefined Behavior in 2017 (part 1 of 2)
summary
Undefined behavior (UB) lets compilers assume impossible conditions, and modern optimizers increasingly turn those assumptions into surprising breakage: GCC/Clang reorders or deletes code, a past Google Native Client refactor dropped a mask when shifting by 32 and weakened its sandbox, and UB makes realloc and memcpy uses silently invalid. Tooling gets better—Purify/Valgrind-era tools evolve into UBSan and fuzzers and projects like Csmith (≈500 compiler bugs found)—but sound static analysis is rare and appendix J lists ~200 UBs to watch for.
AI-written summary · about
chapters (4)
- 0:00Introduction to UB
- 7:17Evolution and consequences
- 19:22Analysis and mitigation
- 48:45Conclusion and next steps
related talks
57mUndefined Behavior is Not an Error
01h 04mRemoving Needless Undefined Behavior for a Safer C++
46m“My Little Optimizer: Undefined Behavior is Magic"
05mDetecting Programs That Rely on Undefined Behavior
01h 30mDangerous Optimizations in C and C++ Programming Languages
58mGarbage In, Garbage Out: Arguing about Undefined Behavior...
19mExploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the(…)
19mLightning Talk: Your Favorite Undefined Behavior in C++
