Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3575693.3575720acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
research-article
Open access

Where Did My Variable Go? Poking Holes in Incomplete Debug Information

Published: 30 January 2023 Publication History
  • Get Citation Alerts
  • Abstract

    The availability of debug information for optimized executables can largely ease crucial tasks such as crash analysis. Source-level debuggers use this information to display program state in terms of source code, allowing users to reason on it even when optimizations alter program structure extensively. A few recent endeavors have proposed effective methodologies for identifying incorrect instances of debug information, which can mislead users by presenting them with an inconsistent program state.
    In this work, we identify and study a related important problem: the completeness of debug information. Unlike correctness issues for which an unoptimized executable can serve as reference, we find there is no analogous oracle to deem when the cause behind an unreported part of program state is an unavoidable effect of optimization or a compiler implementation defect. In this scenario, we argue that empirically derived conjectures on the expected availability of debug information can serve as an effective means to expose classes of these defects.
    We propose three conjectures involving variable values and study how often synthetic programs compiled with different configurations of the popular gcc and LLVM compilers deviate from them. We then discuss techniques to pinpoint the optimizations behind such violations and minimize bug reports accordingly. Our experiments revealed, among others, 24 bugs already confirmed by the developers of the gcc-gdb and clang-lldb ecosystems.

    References

    [1]
    Ali-Reza Adl-Tabatabai and Thomas Gross. 1993. Detection and Recovery of Endangered Variables Caused by Instruction Scheduling. In Proc. of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation (PLDI ’93). Association for Computing Machinery, 13–25. isbn:0897915984 https://doi.org/10.1145/155090.155092
    [2]
    Ali-Reza Adl-Tabatabai and Thomas Gross. 1996. Source-Level Debugging of Scalar Optimized Code. In Proc. of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI ’96). Association for Computing Machinery, 33–43. isbn:0897917952 https://doi.org/10.1145/231379.231388
    [3]
    Fiorella Artuso, Giuseppe Antonio Di Luna, and Leonardo Querzoni. 2022. Debugging Debug Information With Neural Networks. IEEE Access, 10 (2022), 54136–54148. https://doi.org/10.1109/ACCESS.2022.3176617
    [4]
    Cristian Assaiante, Daniele Cono D’Elia, Giuseppe Antonio Di Luna, and Leonardo Querzoni. 2022. Where Did My Variable Go? Poking Holes in Incomplete Debug Information. https://doi.org/10.48550/ARXIV.2211.09568
    [5]
    Gary Brooks, Gilbert J. Hansen, and Steve Simmons. 1992. A New Approach to Debugging Optimized Code. In Proc. of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation (PLDI ’92). Association for Computing Machinery, 1–11. isbn:0897914759 https://doi.org/10.1145/143095.143108
    [6]
    Junjie Chen, Wenxiang Hu, Dan Hao, Yingfei Xiong, Hongyu Zhang, Lu Zhang, and Bing Xie. 2016. An Empirical Comparison of Compiler Testing Techniques. In Proc. of the 38th International Conference on Software Engineering (ICSE ’16). Association for Computing Machinery, 180–190. isbn:9781450339001 https://doi.org/10.1145/2884781.2884878
    [7]
    Yang Chen, Alex Groce, Chaoqiang Zhang, Weng-Keen Wong, Xiaoli Fern, Eric Eide, and John Regehr. 2013. Taming Compiler Fuzzers. In Proc. of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’13). Association for Computing Machinery, 197–208. isbn:9781450320146 https://doi.org/10.1145/2491956.2462173
    [8]
    Max Copperman. 1994. Debugging Optimized Code without Being Misled. ACM Trans. Program. Lang. Syst., 16, 3 (1994), may, 387–427. issn:0164-0925 https://doi.org/10.1145/177492.177517
    [9]
    Chris Cummins, Pavlos Petoumenos, Alastair Murray, and Hugh Leather. 2018. Compiler Fuzzing through Deep Learning. In Proc. of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2018). Association for Computing Machinery, 95–105. isbn:9781450356992 https://doi.org/10.1145/3213846.3213848
    [10]
    Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. 1991. Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Trans. Program. Lang. Syst., 13, 4 (1991), oct, 451–490. issn:0164-0925 https://doi.org/10.1145/115372.115320
    [11]
    Daniele Cono D’Elia and Camil Demetrescu. 2018. On-Stack Replacement, Distilled. In Proc. of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2018). Association for Computing Machinery, 166–180. isbn:9781450356985 https://doi.org/10.1145/3192366.3192396
    [12]
    Daniele Cono D’Elia, Lorenzo Invidia, Federico Palmaro, and Leonardo Querzoni. 2022. Evaluating Dynamic Binary Instrumentation Systems for Conspicuous Features and Artifacts. Digital Threats, 3, 2 (2022), Article 10, feb, 13 pages. issn:2692-1626 https://doi.org/10.1145/3478520
    [13]
    Giuseppe Antonio Di Luna, Davide Italiano, Luca Massarelli, Sebastian Österlund, Cristiano Giuffrida, and Leonardo Querzoni. 2021. Who’s Debugging the Debuggers? Exposing Debug Information Bugs in Optimized Binaries. In Proc. of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2021). Association for Computing Machinery, 1034–1045. isbn:9781450383172 https://doi.org/10.1145/3445814.3446695
    [14]
    Vijay D’Silva, Mathias Payer, and Dawn Song. 2015. The Correctness-Security Gap in Compiler Optimization. In 2015 IEEE Security and Privacy Workshops. 73–87. https://doi.org/10.1109/SPW.2015.33
    [15]
    Michael D. Ernst, Jake Cockrell, William G. Griswold, and David Notkin. 1999. Dynamically Discovering Likely Program Invariants to Support Program Evolution. In Proc. of the 21st International Conference on Software Engineering (ICSE ’99). Association for Computing Machinery, 213–224. isbn:1581130740 https://doi.org/10.1145/302405.302467
    [16]
    Karine Even-Mendoza, Cristian Cadar, and Alastair F. Donaldson. 2022. CsmithEdge: More Effective Compiler Testing by Handling Undefined Behaviour Less Conservatively. Empirical Softw. Engg., 27, 6 (2022), nov, 35 pages. issn:1382-3256 https://doi.org/10.1007/s10664-022-10146-1
    [17]
    Andrea Fioraldi, Daniele Cono D’ Elia, and Davide Balzarotti. 2021. The Use of Likely Invariants as Feedback for Fuzzers. In 30th USENIX Security Symposium (USENIX Security 21). USENIX Association, 2829–2846. isbn:978-1-939133-24-3 https://www.usenix.org/conference/usenixsecurity21/presentation/fioraldi
    [18]
    gcc bug tracker. 2022. gcc bug ID: 104938. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104938
    [19]
    gcc bug tracker. 2022. gcc bug ID: 105108. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105108
    [20]
    gcc bug tracker. 2022. gcc bug ID: 105145. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105145
    [21]
    gcc bug tracker. 2022. gcc bug ID: 105158. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105158
    [22]
    gcc bug tracker. 2022. gcc bug ID: 105161. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105161
    [23]
    gcc bug tracker. 2022. gcc bug ID: 105179. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105179
    [24]
    gcc bug tracker. 2022. gcc bug ID: 105249. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105249
    [25]
    gdb bug tracker. 2022. gdb bug ID: 28987. https://sourceware.org/bugzilla/show_bug.cgi?id=28987
    [26]
    John Hennessy. 1982. Symbolic Debugging of Optimized Code. ACM Trans. Program. Lang. Syst., 4, 3 (1982), jul, 323–344. issn:0164-0925 https://doi.org/10.1145/357172.357173
    [27]
    Clara Jaramillo, Rajiv Gupta, and Mary Lou Soffa. 2000. FULLDOC: A Full Reporting Debugger for Optimized Code. In Proc. of the 7th International Symposium on Static Analysis (SAS ’00). Springer-Verlag, 240–259. isbn:3540676686
    [28]
    Changjiang Jia and W. K. Chan. 2013. Which Compiler Optimization Options Should I Use for Detecting Data Races in Multithreaded Programs? In Proc. of the 8th International Workshop on Automation of Software Test (AST ’13). IEEE Press, 53–56. isbn:9781467361613
    [29]
    Xavier Leroy. 2009. Formal Verification of a Realistic Compiler. Commun. ACM, 52, 7 (2009), jul, 107–115. issn:0001-0782 https://doi.org/10.1145/1538788.1538814
    [30]
    Yuanbo Li, Shuo Ding, Qirun Zhang, and Davide Italiano. 2020. Debug Information Validation for Optimized Code. In Proc. of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, 1052–1065. isbn:9781450376136 https://doi.org/10.1145/3385412.3386020
    [31]
    LLVM bug tracker. 2021. clang bug ID: 49546. https://bugs.llvm.org/show_bug.cgi?id=49546
    [32]
    LLVM bug tracker. 2021. clang bug ID: 49975. https://bugs.llvm.org/show_bug.cgi?id=49975
    [33]
    LLVM bug tracker. 2021. clang bug ID: 51780. https://bugs.llvm.org/show_bug.cgi?id=51780
    [34]
    LLVM bug tracker. 2021. lldb bug ID: 50076. https://bugs.llvm.org/show_bug.cgi?id=50076
    [35]
    LLVM bug tracker. 2022. clang bug ID: 53855. https://github.com/llvm/llvm-project/issues/53855
    [36]
    LLVM bug tracker. 2022. clang bug ID: 54757. https://github.com/llvm/llvm-project/issues/54757
    [37]
    LLVM bug tracker. 2022. clang bug ID: 55115. https://github.com/llvm/llvm-project/issues/55115
    [38]
    John Regehr, Yang Chen, Pascal Cuoq, Eric Eide, Chucky Ellison, and Xuejun Yang. 2012. Test-Case Reduction for C Compiler Bugs. In Proc. of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’12). Association for Computing Machinery, 335–346. isbn:9781450312059 https://doi.org/10.1145/2254064.2254104
    [39]
    Swarup Kumar Sahoo, John Criswell, Chase Geigle, and Vikram Adve. 2013. Using Likely Invariants for Automated Software Fault Localization. In Proc. of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’13). Association for Computing Machinery, 139–152. isbn:9781450318709 https://doi.org/10.1145/2451116.2451131
    [40]
    David Schuler, Valentin Dallmeier, and Andreas Zeller. 2009. Efficient Mutation Testing by Checking Invariant Violations. In Proc. of the Eighteenth International Symposium on Software Testing and Analysis (ISSTA ’09). Association for Computing Machinery, 69–80. isbn:9781605583389 https://doi.org/10.1145/1572272.1572282
    [41]
    Chengnian Sun, Vu Le, and Zhendong Su. 2016. Finding Compiler Bugs via Live Code Mutation. In Proc. of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). Association for Computing Machinery, 849–863. isbn:9781450344449 https://doi.org/10.1145/2983990.2984038
    [42]
    Le-Chun Wu, Rajiv Mirani, Harish Patil, Bruce Olsen, and Wen-mei W. Hwu. 1999. A New Framework for Debugging Globally Optimized Code. In Proc. of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation (PLDI ’99). Association for Computing Machinery, 181–191. isbn:1581130945 https://doi.org/10.1145/301618.301663
    [43]
    Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In Proc. of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11). Association for Computing Machinery, 283–294. isbn:9781450306638 https://doi.org/10.1145/1993498.1993532

    Cited By

    View all
    • (2024)DTD: Comprehensive and Scalable Testing for DebuggersProceedings of the ACM on Software Engineering10.1145/36437791:FSE(1172-1193)Online publication date: 12-Jul-2024
    • (2024)Evading Userland API Hooking, Again: Novel Attacks and a Principled Defense MethodDetection of Intrusions and Malware, and Vulnerability Assessment10.1007/978-3-031-64171-8_8(150-173)Online publication date: 9-Jul-2024
    • (2023)Divak: Non-invasive Characterization of Out-of-Bounds Write VulnerabilitiesDetection of Intrusions and Malware, and Vulnerability Assessment10.1007/978-3-031-35504-2_11(211-232)Online publication date: 12-Jul-2023

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ASPLOS 2023: Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2
    January 2023
    947 pages
    ISBN:9781450399166
    DOI:10.1145/3575693
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 30 January 2023

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Debuggers
    2. compiler bugs
    3. compiler optimizations

    Qualifiers

    • Research-article

    Conference

    ASPLOS '23

    Acceptance Rates

    Overall Acceptance Rate 535 of 2,713 submissions, 20%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)378
    • Downloads (Last 6 weeks)37
    Reflects downloads up to 10 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)DTD: Comprehensive and Scalable Testing for DebuggersProceedings of the ACM on Software Engineering10.1145/36437791:FSE(1172-1193)Online publication date: 12-Jul-2024
    • (2024)Evading Userland API Hooking, Again: Novel Attacks and a Principled Defense MethodDetection of Intrusions and Malware, and Vulnerability Assessment10.1007/978-3-031-64171-8_8(150-173)Online publication date: 9-Jul-2024
    • (2023)Divak: Non-invasive Characterization of Out-of-Bounds Write VulnerabilitiesDetection of Intrusions and Malware, and Vulnerability Assessment10.1007/978-3-031-35504-2_11(211-232)Online publication date: 12-Jul-2023

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media