A Differential Approach to Undefined Behavior Detection.

Saved in:
Bibliographic Details
Title: A Differential Approach to Undefined Behavior Detection.
Authors: Xi Wang1 xi@cs.washington.edu, Zeldovich, Nickolai2 nickolai@csail.mit.edu, Kaashoek, M. Frans2 kaashoek@csail.mit.edu, Solar-Lezama, Armando2 asolar@csail.mit.edu
Source: Communications of the ACM. Mar2016, Vol. 59 Issue 3, p99-106. 8p. 6 Diagrams.
Subjects: Systems programming (Computer science), Programming languages, Compilers (Computer programs), Databases, Computer software
Abstract: This paper 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 paper proposes a formal and practical approach, which 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 Stack that precisely identifies undefined behavior bugs. Applying Stack to widely used systems has uncovered 161 new bugs that have been confirmed and fixed by developers. [ABSTRACT FROM AUTHOR]
Copyright of Communications of the ACM is the property of Association for Computing Machinery and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Database: Engineering Source
Description
Abstract:This paper 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 paper proposes a formal and practical approach, which 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 Stack that precisely identifies undefined behavior bugs. Applying Stack to widely used systems has uncovered 161 new bugs that have been confirmed and fixed by developers. [ABSTRACT FROM AUTHOR]
ISSN:00010782
DOI:10.1145/2885256