Type-Centric Kotlin Compiler Fuzzing: Preserving Test Program Correctness by Preserving Types

12/11/2020
by   Daniil Stepanov, et al.
0

Kotlin is a relatively new programming language from JetBrains: its development started in 2010 with release 1.0 done in early 2016. The Kotlin compiler, while slowly and steadily becoming more and more mature, still crashes from time to time on the more tricky input programs, not least because of the complexity of its features and their interactions. This makes it a great target for fuzzing, even the basic forms of which can find a significant number of Kotlin compiler crashes. There is a problem with fuzzing, however, closely related to the cause of the crashes: generating a random, non-trivial and semantically valid Kotlin program is hard. In this paper, we talk about type-centric compiler fuzzing in the form of type-centric enumeration, an approach inspired by skeletal program enumeration and based on a combination of generative and mutation-based fuzzing, which solves this problem by focusing on program types. After creating the skeleton program, we fill the typed holes with fragments of suitable type, created via generation and enhanced by semantic-aware mutation. We implemented this approach in our Kotlin compiler fuzzing framework called Backend Bug Finder (BBF) and did an extensive evaluation, not only testing the real-world feasibility of our approach, but also comparing it to other compiler fuzzing techniques. The results show our approach to be significantly better compared to other fuzzing approaches at generating semantically valid Kotlin programs, while creating more interesting crash-inducing inputs at the same time. We managed to find more than 50 previously unknown compiler crashes, of which 18 were considered important after their triage by the compiler team.

READ FULL TEXT
research
01/01/2018

TWAM: A Certifying Abstract Machine for Logic Programs

Type-preserving (or typed) compilation uses typing derivations to certif...
research
09/16/2019

ReduKtor: How We Stopped Worrying About Bugs in Kotlin Compiler

Bug localization is well-known to be a difficult problem in software eng...
research
02/02/2023

Effective Random Test Generation for Deep Learning Compilers

Deep learning compilers help address difficulties of deploying deep lear...
research
02/16/2018

Compositional Verification of Compiler Optimisations on Relaxed Memory

A valid compiler optimisation transforms a block in a program without in...
research
01/25/2022

The Unexplored Terrain of Compiler Warnings

The authors' industry experiences suggest that compiler warnings, a ligh...
research
02/25/2023

A Bottom-Up Approach to a Unified Semantic Interface for Verified Compositional Compilation

Verified compositional compilation (VCC) is a notion of modular verifica...
research
07/02/2023

LLM4CBI: Taming LLMs to Generate Effective Test Programs for Compiler Bug Isolation

Compiler bugs pose a significant threat to safety-critical applications,...

Please sign up or login with your details

Forgot password? Click here to reset