Well-typed programs can go wrong: a study of typing-related bugs in JVM compilers
Stefanos Chaliasos, Thodoris Sotiropoulos, Georgios-Petros Drosos, Charalambos Mitropoulos, Dimitris Mitropoulos, Diomidis Spinellis
Abstract
Despite the substantial progress in compiler testing, research endeavors have mainly focused on detecting compiler crashes and subtle miscompilations caused by bugs in the implementation of compiler optimizations. Surprisingly, this growing body of work neglects other compiler components, most notably the front-end. In statically-typed programming languages with rich and expressive type systems and modern features, such as type inference or a mix of object-oriented with functional programming features, the process of static typing in compiler front-ends is complicated by a high-density of bugs. Such bugs can lead to the acceptance of incorrect programs (breaking code portability or the type system's soundness), the rejection of correct (e.g. well-typed) programs, and the reporting of misleading errors and warnings.
We conduct, what is to the best of our knowledge, the first empirical study for understanding and characterizing typing-related compiler bugs. To do so, we manually study 320 typing-related bugs (along with their fixes and test cases) that are randomly sampled from four mainstream JVM languages, namely Java, Scala, Kotlin, and Groovy. We evaluate each bug in terms of several aspects, including their symptom, root cause, bug fix's size, and the characteristics of the bug-revealing test cases. Some representative observations indicate that: (1) more than half of the typing-related bugs manifest as unexpected compile-time errors: the buggy compiler wrongly rejects semantically correct programs, (2) the majority of typing-related bugs lie in the implementations of the underlying type systems and in other core components related to operations on types, (3) parametric polymorphism is the most pervasive feature in the corresponding test cases, (4) one third of typing-related bugs are triggered by non-compilable programs.
We believe that our study opens up a new research direction by driving future researchers to build appropriate methods and techniques for a more holistic testing of compilers.
CCS Concepts: • Software and its engineering → Compilers; Software testing and debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 18ee70b8-a448-41f1-a4a9-7b6fcf55f604Cited by top-tier papers13
- Finding typing compiler bugsStefanos Chaliasos, Thodoris Sotiropoulos, Diomidis Spinellis, Arthur Gervais et al.PLDI 2022 · 36 citations
- SoK: What don't we know? Understanding Security Vulnerabilities in SNARKsStefanos Chaliasos, Jens Ernstberger, David Theodore, David Wong et al.USENIX Security 2024 · 32 citations
- Fuzzing Deep Learning Compilers with HirGenHaoyang Ma, Qingchao Shen, Yongqiang Tian, Junjie Chen et al.ISSTA 2023 · 24 citations
- A study of inline assembly in solidity smart contractsStefanos Chaliasos, Arthur Gervais, Benjamin LivshitsOOPSLA 2022 · 22 citations
- Interoperability in Deep Learning: A User Survey and Failure Analysis of ONNX Model ConvertersPurvish Jajal, Wenxin Jiang, Arav Tewari, Erik Kocinare et al.ISSTA 2024 · 19 citations
Builds on4
- Random testing for C and C++ compilers with YARPGenVsevolod Livinskii, Dmitry Babokin, John RegehrOOPSLA 2020 · 140 citations
- Fuzzing JavaScript Engines with Aspect-preserving MutationSoyeon Park, Wen Xu, Insu Yun, Daehee Jang et al.S&P 2020 · 126 citations
- SLEMI: equivalence modulo input (EMI) based mutation of CPS models for finding compiler bugs in SimulinkShafiul Azam Chowdhury, Sohil Lal Shrestha, Taylor T. Johnson, Christoph CsallnerICSE 2020 · 35 citations
- Actor concurrency bugs: a comprehensive study on symptoms, root causes, API usages, and differencesMehdi Bagherzadeh, Nicholas Fireman, Anas Shawesh, Raffi KhatchadourianOOPSLA 2020 · 13 citations
Related papers
- API-Driven Program Synthesis for Testing Static Typing ImplementationsThodoris Sotiropoulos, Stefanos Chaliasos, Zhendong SuPOPL 2024 · 15 citations
- An Empirical Study of Bugs in the rustc CompilerZixi Liu, Yang Feng, Yunbo Ni, Shaohua Li et al.OOPSLA 2025 · 5 citations
- Finding Compiler Bugs through Cross-Language Code Generator and Differential TestingQiong Feng, Xiaotian Ma, Ziyuan Feng, Marat Akhin et al.OOPSLA 2025 · 2 citations
- Understanding and Finding Java Decompiler BugsYifei Lu, Weidong Hou, Minxue Pan, Xuandong Li et al.OOPSLA 2024 · 5 citations
- Understanding and Finding JIT Compiler Performance BugsZijian Yi, Cheng Ding, August Shi, Milos GligoricOOPSLA 2026
