kirancodes.me
To Proof Maintenance & Beyond!

PPR: Pairwise Program Reduction

Mengxiao Zhang, Zhenyang Xu, Yongqiang Tian, Yu Jiang, Chengnian Sun

Abstract

Program reduction is a practical technique widely used for debugging compilers. To report a compiler bug with a bug-triggering program, one needs to minimize the program by removing bugirrelevant program elements first. Though existing program reduction techniques, such as C-Reduce and Perses, can reduce a bug-triggering program as a whole, they overlook the fact that the degree of relevance of each remaining token to the bug varies. To this end, we propose Pairwise Program Reduction (PPR), a new program reduction technique for minimizing a pair of programs w.r.t. certain properties. Given a seed program ๐‘ƒ๐‘  , a variant ๐‘ƒ๐‘ฃ derived from ๐‘ƒ๐‘  , and the properties ๐‘ƒ๐‘  and ๐‘ƒ๐‘ฃ exhibit separately (e.g., ๐‘ƒ๐‘ฃ crashes a compiler whereas ๐‘ƒ๐‘  does not), PPR not only reduces the sizes of ๐‘ƒ๐‘  and ๐‘ƒ๐‘ฃ , but also minimizes the differences between ๐‘ƒ๐‘  and ๐‘ƒ๐‘ฃ . The final result of PPR is a pair of minimized programs that still preserve the properties, but the minimized differences between the pair highlight the critical program elements that are highly related to the bug. To thoroughly evaluate PPR, we manually constructed the first pairwise benchmark suite from real-world compiler bugs (20 bugs in GCC and LLVM, 9 bugs in Rustc and 9 bugs in JerryScript). The evaluation results show that PPR significantly outperforms the baseline: DD, a variant of Delta Debugging. Specifically, on large and complex programs, PPRโ€™s reduction results are only 0.6% of those by DD w.r.t. program size. The sizes of the minimized variants (i.e., ๐‘ƒ๐‘ฃ ) by PPR are also comparable to those by Perses and C-Reduce; but PPR offers more for debugging by highlighting the critical, bug-inducing changes via the minimized differences. Evaluation on Rust and JavaScript demonstrates PPRโ€™s strong generality to other languages.

BibTeX
@inproceedings{Zhang-al:FSE23,
  author    = {Mengxiao Zhang and
               Zhenyang Xu and
               Yongqiang Tian and
               Yu Jiang and
               Chengnian Sun},
  title     = {{PPR:} Pairwise Program Reduction},
  booktitle = {{ESEC/SIGSOFT} {FSE}},
  pages     = {338--349},
  publisher = {{ACM}},
  year      = {2023},
}

Related papers