A Differential Approach to Undefined Behavior Detection

Xi Wang,Nickolai Zeldovich,M. Frans Kaashoek,Armando Solar-Lezama
DOI: https://doi.org/10.1145/2699678
2015-03-11
ACM Transactions on Computer Systems
Abstract:This article studies undefined behavior arising in systems programming languages such as C/C++. Undefined behavior bugs lead to unpredictable and subtle systems behavior, and their effects can be further amplified by compiler optimizations. Undefined behavior bugs are present in many systems, including the Linux kernel and the Postgres database. The consequences range from incorrect functionality to missing security checks. This article proposes a formal and practical approach that finds undefined behavior bugs by finding “unstable code” in terms of optimizations that leverage undefined behavior. Using this approach, we introduce a new static checker called S tack that precisely identifies undefined behavior bugs. Applying S tack to widely used systems has uncovered 161 new bugs that have been confirmed and fixed by developers.
computer science, theory & methods
What problem does this paper attempt to address?