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

11/27/2020
by   Giuseppe Antonio Di Luna, et al.
0

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.

READ FULL TEXT
research
12/01/2021

Common Bugs in Scratch Programs

Bugs in Scratch programs can spoil the fun and inhibit learning success....
research
10/10/2022

The Foil: Capture-Avoiding Substitution With No Sharp Edges

Correctly manipulating program terms in a compiler is surprisingly diffi...
research
05/20/2021

Testing DBMS Performance with Mutations

Because database systems are the critical component of modern data-inten...
research
01/18/2022

BinGo: Pinpointing Concurrency Bugs in Go via Binary Analysis

Golang (also known as Go for short) has become popular in building concu...
research
02/15/2021

JEST: N+1-version Differential Testing of Both JavaScript Engines and Specification

Modern programming follows the continuous integration (CI) and continuou...
research
12/11/2020

WITCHER : Detecting Crash Consistency Bugs in Non-volatile Memory Programs

The advent of non-volatile main memory (NVM) enables the development of ...
research
07/05/2020

Static Detection of Uninitialized Stack Variables in Binary Code

More than two decades after the first stack smashing attacks, memory cor...

Please sign up or login with your details

Forgot password? Click here to reset