arrow
Return

Finding Compiler Bugs through Cross-Language Code Generator and Differential Testing

delete2025-10-01
delete0
PRE
AI
Q
Qiong Feng *
X
Xiaotian Ma
Z
Ziyuan Feng
M
Marat Akhin
W
Wei Song
P
Peng Liang
DOI:10.1145/3763152delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Compilers play a central role in translating high-level code into executable programs, making their correctness essential for ensuring code safety and reliability. While extensive research has focused on verifying the correctness of compilers for single-language compilation, the correctness of cross-language compilation - which involves the interaction between two languages and their respective compilers - remains largely unexplored. To fill this research gap, we propose CROSSLANGFUZZER, a novel framework that introduces a universal intermediate representation (IR) for JVM-based languages and automatically generates cross-language test programs with diverse type parameters and complex inheritance structures. After generating the initial IR, CROSSLANGFUZZER applies three mutation techniques - LangShuffler, FunctionRemoval, and TypeChanger - to enhance program diversity. By evaluating both the original and mutated programs across multiple compiler versions, CROSSLANGFUZZER successfully uncovered 10 confirmed bugs in the Kotlin compiler, 4 confirmed bugs in the Groovy compiler, 7 confirmed bugs in the Scala 3 compiler, 2 confirmed bugs in the Scala 2 compiler, and 1 confirmed bug in the Java compiler. Among all mutators, TypeChanger is the most effective, detecting 11 of the 24 compiler bugs. Furthermore, we analyze the symptoms and root causes of cross-compilation bugs, examining the respective responsibilities of language compilers when incorrect behavior occurs during cross-language compilation. To the best of our knowledge, this is the first work specifically focused on identifying and diagnosing compiler bugs in cross-language compilation scenarios. Our research helps to understand these challenges and contributes to improving compiler correctness in multi-language environments.
Keywords:
Cross-Language
Code Generator
JVM
Differential Testing

Journal

P
Proceedings of the ACM on Programming Languages-PACMPL
IF:
2.8
Papers:
308
Citations:
4.7K

Organization

W
Wuhan University
Scholars:
5.0K
Papers: 1.7K
Citations: 10.0W
Cited Papers

Cited Papers

Compiler validation via equivalence modulo inputs
err2014-06-09
err0
PREAI
errVu Le; Mehrdad Afshari; Zhendong Su
errShare
errSave
Fuzz4All: Universal Fuzzing with Large Language Models
err2024-04-12
err0
errOAAI
errChunqiu Steven Xia; Matteo Paltenghi; Jia Le Tian; Michael Pradel; Lingming Zhang
errShare
errSave
Automated detection of inter-language design smells in multi-language deep learning frameworks
err2025-03-01
err0
PREAI
errLi, Zengyang; Zhang, Xiaoyong; Wang, Wenshuo; Liang, Peng; Mo, Ran; Tan, Jie; Liu, Hui
errShare
errSave
SJFuzz: Seed and Mutator Scheduling for JVM Fuzzing
err2023-11-30
err0
PREAI
errMingyuan Wu; Yicheng Ouyang; Minghai Lu; Junjie Chen; Yingquan Zhao; Heming Cui; Guowei Yang; Yuqun Zhang
errShare
errSave
Finding typing compiler bugs
err2022-06-09
err0
PREAI
errChaliasos,Stefanos; Sotiropoulos,Thodoris; Spinellis,Diomidis; Gervais,Arthur; Livshits,Benjamin; Mitropoulos,Dimitris
errShare
errSave
researcher View more