IEEE Transactions on Reliability · 2022 · 21 citations · 38 references
ComputingComputer EngineeringComputer ScienceCompilersProgramming LanguagesSoftware EngineeringCompiler Back EndsSoftware TestingAutomated Bug FindingCompiler DesignCompiler Front EndsImplementation BugsMutationMutation Testing
C++ is a widely used programming language and the C++ front-end is a critical part of a C++ compiler. Although many techniques have been proposed to test compilers, few studies are devoted to detecting bugs in C++ compiler. In this study, we take the first step to detect bugs in C++ compiler front-ends. To do so, two main challenges need to be addressed, namely, the acquisition of test programs that are more likely to trigger bugs in compiler front-ends and the bug identification from complicated compiler outputs. In this article, we propose a novel framework named <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Ccoft</small> to detect bugs in C++ compiler front-ends. To address the first challenge, <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Ccoft</small> implements a practical program generator. The generator first transforms C++ grammars into a flexible structured format and then utilizes an equal-chance selection (ECS) strategy to conduct structure-aware grammar mutation to generate diverse C++ programs. Next, <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Ccoft</small> employs a set of differential testing strategies to identify various kinds of bugs in C++ compiler front-ends by comparing complex outputs emitted by C++ compilers, thus tackling the second challenge. Empirical evaluation results over two mainstream compilers (i.e., GCC and Clang) show that <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Ccoft</small> greatly improves two state-of-the-art approaches (i.e., Dharma and Grammarinator) by 135% and 111% in terms of the numbers of detected bugs, respectively. By running <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Ccoft</small> for three months, we have successfully reported 136 bugs for two C++ compilers, of which 78 (57 confirmed, assigned, or fixed) for GCC and 58 (10 confirmed or fixed) for Clang.
38
Finding and understanding bugs in C compilers
Xuejun Yang, Yang Chen, Eric Eide et al. · 2011 · 733 citations
Differential Testing for Software.
W. M. McKeeman · 1998 · 454 citations
Compiler validation via equivalence modulo inputs
Vu Le, Mehrdad Afshari, Zhendong Su · 2014 · 372 citations
Test-case reduction for C compiler bugs
John Regehr, Yang Chen, Pascal Cuoq et al. · 2012 · 294 citations
Superion: Grammar-Aware Greybox Fuzzing
Junjie Wang, Bihuan Chen, Lei Wei et al. · 2019 · 248 citations