Abstract
Despite the advancements in software testing, bugs still plague deployed software and result in crashes in production. When debugging issues-sometimes caused by "heisenbugs"-there is the need to interpret core dumps and reproduce the issue offline on the same binary deployed. This requires the entire toolchain (compiler, linker, debugger) to correctly generate and use debug information. Little attention has been devoted to checking that such information is correctly preserved by modern toolchains' optimization stages. This is particularly important as managing debug information in optimized production binaries is non-trivial, often leading to toolchain bugs that may hinder post-deployment debugging efforts. In this paper, we present Debug2, a framework to find debug information bugs in modern toolchains. Our framework feeds random source programs to the target toolchain and surgically compares the debugging behavior of their optimized/unoptimized binary variants. Such differential analysis allows Debug2 to check invariants at each debugging step and detect bugs from invariant violations. Our invariants are based on the (in)consistency of common debug entities, such as source lines, stack frames, and function arguments. We show that, while simple, this strategy yields powerful cross-toolchain and cross-language invariants, which can pinpoint several bugs in modern toolchains. We have used Debug2 to find 23 bugs in the LLVM toolchain (clang/lldb), 8 bugs in the GNU toolchain (GCC/gdb), and 3 in the Rust toolchain (rustc/lldb)-with 14 bugs already fixed by the developers.
Original language | English |
---|---|
Title of host publication | ASPLOS 2021 |
Subtitle of host publication | Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems |
Publisher | Association for Computing Machinery |
Pages | 1034-1045 |
Number of pages | 12 |
ISBN (Electronic) | 9781450383172 |
DOIs | |
Publication status | Published - Apr 2021 |
Event | 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2021 - Virtual, Online, United States Duration: 19 Apr 2021 → 23 Apr 2021 |
Conference
Conference | 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2021 |
---|---|
Country/Territory | United States |
City | Virtual, Online |
Period | 19/04/21 → 23/04/21 |
Bibliographical note
Funding Information:Acknowledgments. We would like to thank our shepherd, James Bornholt, and the anonymous reviewers for their comments. The VU Amsterdam researchers were supported by the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 786669 (ReAct) and by Cisco Systems, Inc. through grant #1138109. Giuseppe Di Luna was supported by the AXA Postdoctoral Fellowship. Sapienza researchers are partially supported by the SAFE project under the Italian PNRM program and by Sapienza grant num. RM11916B75A3293D. The authors would like to thank Daniele Cono D’Elia for constructive criticism and insightful comments on a previous version of this manuscript.
Publisher Copyright:
© 2021 ACM.
Copyright:
Copyright 2021 Elsevier B.V., All rights reserved.
Keywords
- Debug Information
- Optimized Binaries
- Verification