我的变量去哪儿了?在不完整的信息中挖掘漏洞
Where Did My Variable Go? Poking Holes in Incomplete Debug Information
摘要:
优化的可执行文件的调试信息的可用性可以在很大程度上简化崩溃分析等关键任务。源代码级调试器使用此信息以源代码的形式显示程序状态,即使优化广泛地改变了程序结构,也允许用户对其进行推理。最近的一些努力已经提出了有效的方法来识别错误的调试信息,这可能会误导用户,他们与一个不一致的程序状态。在这项工作中,我们确定和研究相关的重要问题:调试信息的完整性。与未优化的可执行文件可以作为参考的正确性问题不同,我们发现,当程序状态的未报告部分背后的原因是优化或编译器实现缺陷的不可避免的影响时,没有类似的Oracle可以考虑。在这种情况下,我们认为,经验得出的预期可用性的调试信息的atturtures可以作为一种有效的手段来暴露这些缺陷的类。我们提出了三种涉及变量值和研究如何经常与流行的GCC和LLVM编译器的不同配置编译的合成程序偏离他们。然后,我们讨论了技术,以查明这种违规背后的优化,并相应地减少错误报告。我们的实验揭示了其中24个bug,这些bug已经被gcc-gdb和clang-lldb生态系统的开发者确认。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。