Compilation Consistency Modulo Debug Information

Theodore Luo Wang, Yongqiang Tian, Yiwen Dong, Zhenyang Xu, Chengnian Sun

Research output: Chapter in Book/Conference Proceeding/ReportConference Paper published in a bookpeer-review

Abstract

Compilation Consistency Modulo Debug Information (CCMD) is an essential compiler property that a production compiler should support: the compiler should emit the same machine code regardless of enabling debug information. CCMD is vital to developers' experiences with debugging a production binary containing no debug information. To debug such a binary, developers need build another binary with the same compiler flags and enable debug information. Without CCMD, the machine code in the latter binary will be different, which can confuse the debugger, hide the bug, or even cause a miscompilation (as GCC once did with the Linux Kernel). This paper is the first to introduce to the research community the validation of CCMD, a new research problem that has been overlooked for decades despite its importance. More importantly, we propose the first testing technique Dfusor to automatically validate CCMD for C compilers. At the high level, given a compilable program P as a seed, Dfusor automatically generates compilable program variants via multiple effective program transformations. Such variants can cause a compiler to emit more debug information than it would when compiling P, thus exercising more code paths in the compiler and increasing the chance to find CCMD bugs. Our extensive evaluations of Dfusor demonstrate that Dfusor can produce variants that exhibit significant increases in the quantity and complexity of the emitted debug information, and thus has found new, real bugs in GCC and LLVM. With a sample of 100 variants derived from distinct seed programs, Dfusor introduces 214% more debug information entries and 36% more distinct debug information entries in the variants than the seeds, and improves the code coverage of GCC and Clang by up to 6.00% and 6.82%. More importantly, Dfusor has found CCMD bugs; within 10 months of development and intermittent testing, Dfusor has found 23 bugs (9 in GCC and 14 in Clang), with 3 confirmed and 18 fixed.

Original languageEnglish
Title of host publicationASPLOS 2023 - Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
EditorsTor M. Aamodt, Natalie Enright Jerger, Michael Swift
PublisherAssociation for Computing Machinery
Pages146-158
Number of pages13
ISBN (Electronic)9781450399166
DOIs
Publication statusPublished - 27 Jan 2023
Externally publishedYes
Event28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2023 - Vancouver, Canada
Duration: 25 Mar 202329 Mar 2023

Publication series

NameInternational Conference on Architectural Support for Programming Languages and Operating Systems - ASPLOS
Volume2

Conference

Conference28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2023
Country/TerritoryCanada
CityVancouver
Period25/03/2329/03/23

Bibliographical note

Publisher Copyright:
© 2023 ACM.

Keywords

  • Compiler Testing
  • Debug Information

Fingerprint

Dive into the research topics of 'Compilation Consistency Modulo Debug Information'. Together they form a unique fingerprint.

Cite this