Random Testing for C and C++ Compilers with YARPGen

Random Testing for C and C++ Compilers with YARPGen
复制标题

DOI:
10.1145/3428264
复制
发表时间:
2020-11-01
影响因子:
1.8
通讯作者:
Regehr, John
Regehr, John
中科院分区:
其他
文献类型:
--
作者:
Livinskii, Vsevolod;Babokin, Dmitry;Regehr, John

文献摘要

被引文献

相似文献

编译器不应该崩溃,也不应该错编译应用程序。随机测试是一种有效的方法,可以发现没有通过其他类型测试的编译器错误。本文介绍了另一个随机程序生成器(YARPGen),这是一个针对C和c++的随机测试用例生成器,我们使用它来发现和报告GCC, LLVM和Intel (R) c++编译器中的220多个错误。我们的研究贡献包括一种生成表达性程序的方法,该程序在不使用动态检查的情况下避免未定义行为,以及生成策略,一种增加生成代码多样性和触发更多优化的机制。生成策略减少了发现难以触发的编译器bug的测试时间,并且对于YARPGen设计用于压力测试的标量优化类型,编译器应用这些优化的次数在LLVM和GCC中平均增加了20%和40%。我们还创建了一些工具来自动化大多数与编译器模糊测试相关的常见任务;这些工具对我们以外的人也很有用。
Compilers should not crash and they should not miscompile applications. Random testing is an effective method for finding compiler bugs that have escaped other kinds of testing. This paper presents Yet Another Random Program Generator (YARPGen), a random test-case generator for C and C++ that we used to find and report more than 220 bugs in GCC, LLVM, and the Intel (R) C++ Compiler. Our research contributions include a method for generating expressive programs that avoid undefined behavior without using dynamic checks, and generation policies, a mechanism for increasing diversity of generated code and for triggering more optimizations. Generation policies decrease the testing time to find hard-to-trigger compiler bugs and, for the kinds of scalar optimizations YARPGen was designed to stress-test, increase the number of times these optimizations are applied by the compiler by an average of 20% for LLVM and 40% for GCC. We also created tools for automating most of the common tasks related to compiler fuzzing; these tools are also useful for fuzzers other than ours.