Litcius/Paper detail

Random testing for C and C++ compilers with YARPGen

Vsevolod Livinskii, Dmitry Babokin, John Regehr

2020Proceedings of the ACM on Programming Languages125 citationsDOIOpen Access PDF

Abstract

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® 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.

Topics & Concepts

CompilerComputer scienceFuzz testingInterprocedural optimizationOptimizing compilerRandom testingParallel computingProgramming languageCompiler correctnessCode generationGenerator (circuit theory)CrashLoop optimizationOperating systemTest caseSoftwareKey (lock)Regression analysisPower (physics)PhysicsMachine learningQuantum mechanicsSoftware Testing and Debugging TechniquesSoftware Engineering ResearchAdvanced Malware Detection Techniques