论文标题

谁在调试辩论者?在优化的二进制文件中揭示调试信息错误

Who is Debugging the Debuggers? Exposing Debug Information Bugs in Optimized Binaries

论文作者

Di Luna, Giuseppe Antonio, Italiano, Davide, Massarelli, Luca, Osterlund, Sebastian, Giuffrida, Cristiano, Querzoni, Leonardo

论文摘要

尽管软件测试取得了进步,但错误仍困扰着部署的软件,并导致生产崩溃。当调试问题(有时是由“海森伯斯”引起的)时,有必要解释核心转储并在同一二进制部署上脱机中的问题。这需要整个工具链(编译器,链接器,调试器)才能正确生成和使用调试信息。很少关注的是检查现代工具链的优化阶段正确保存此类信息。这一点尤其重要,因为在优化的生产二进制文件中管理调试信息是非平凡的,通常会导致工具链错误,这可能会阻碍部署后的调试工作。在本文中,我们提出了调试$^{2} $,这是一个在现代工具链中查找调试信息错误的框架。我们的框架将随机源程序馈送到目标工具链,并通过手术比较其优化/不优化的二进制变体的调试行为。这种差分分析允许调试$^{2} $在每个调试步骤中检查不变性,并检测出不变违规的错误。我们的不变性基于常见调试实体的(源线,堆栈框架和函数参数)的(在)一致性。我们表明,尽管简单,但这种策略会产生强大的跨语链和跨语言不变性,这可以在现代工具链中查明几个错误。我们已经使用debug $^{2} $在LLVM工具链(Clang/LLDB)中找到23个错误,GNU工具链(GCC/GDB)中的8个错误​​,以及Rust Toolchain(Rustc/LLDB)中的3个错误 - 开发人员已经修复了14个错误。

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 Debug$^{2}$, 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 Debug$^{2}$ 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 Debug$^{2}$ 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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源