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 \n 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.
翻译:尽管软件测试有所进步, 错误仍然困扰着软件, 并导致生产崩溃。 当调试问题( 有时由“ ensenbugs” 引起) 时, 当调试问题( 有时由“ ensenbugs” 引起) 时, 需要解析核心倾弃并在同一双进式部署中将问题从下线复制出来。 这就要求整个工具链( compliler、 likeer、 调试器) 正确生成和使用调试信息。 很少注意检查这种信息是否被现代工具链的优化优化阶段保存。 这一点特别重要, 因为管理最优化的生产二进制中的链条调试信息是非三进制的, 往往导致工具链错误, 可能阻碍部署后调试的努力。 在本文件中, 我们提出调试$%2$2}, 一个在现代工具链中找到调试错误信息错误的框架。 我们的框架向目标链中输入随机源程序, 并且将工具中显示 23 。