Compiler Testing using Template Java Programs

09/09/2022
by   Zhiqiang Zang, et al.
0

We present JAttack, a framework that enables template-based testing for compilers. Using JAttack, a developer writes a template program that describes a set of programs to be generated and given as test inputs to a compiler. Such a framework enables developers to incorporate their domain knowledge on testing compilers, giving a basic program structure that allows for exploring complex programs that can trigger sophisticated compiler optimizations. A developer writes a template program in the host language (Java) that contains holes to be filled by JAttack. Each hole, written using a domain-specific language, constructs a node within an extended abstract syntax tree (eAST). An eAST node defines the search space for the hole, i.e., a set of expressions and values. JAttack generates programs by executing templates and filling each hole by randomly choosing expressions and values (available within the search space defined by the hole). Additionally, we introduce several optimizations to reduce JAttack's generation cost. While JAttack could be used to test various compiler features, we demonstrate its capabilities in helping test just-in-time (JIT) Java compilers, whose optimizations occur at runtime after a sufficient number of executions. Using JAttack, we have found six critical bugs that were confirmed by Oracle developers. Four of them were previously unknown, including two unknown CVEs (Common Vulnerabilities and Exposures). JAttack shows the power of combining developers' domain knowledge (via templates) with random testing to detect bugs in JIT compilers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/13/2017

Liveness-Driven Random Program Generation

Randomly generated programs are popular for testing compilers and progra...
research
05/04/2017

Compile-Time Symbolic Differentiation Using C++ Expression Templates

Template metaprogramming is a popular technique for implementing compile...
research
05/04/2023

Distributed System Fuzzing

Grey-box fuzzing is the lightweight approach of choice for finding bugs ...
research
04/15/2021

Automated Conformance Testing for JavaScript Engines via Deep Compiler Fuzzing

JavaScript (JS) is a popular, platform-independent programming language....
research
07/01/2022

HyperTensioN and Total-order Forward Decomposition optimizations

Hierarchical Task Networks (HTN) planners generate plans using a decompo...
research
05/19/2020

Choreographies as Objects

We present Choral, the first framework for programming choreographies (m...
research
05/06/2020

A Collaborative Filtering Approah for the Automatic Tuning of Compiler Optimisations

Selecting the right compiler optimisations has a severe impact on progra...

Please sign up or login with your details

Forgot password? Click here to reset