Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real Programs
Hongyan Gao, Yibiao Yang, Maolin Sun, Jiangchang Wu, Yuming Zhou, Baowen Xu
摘要
Ensuring the reliability of the Rust compiler is of paramount importance, given increasing adoption of Rust for critical systems development, due to its emphasis on memory and thread safety. However, generating valid test programs for the Rust compiler poses significant challenges, given Rust's complex syntax and strict requirements. With the growing popularity of large language models (LLMs), much research in software testing has explored using LLMs to generate test cases. Still, directly using LLMs to generate Rust programs often results in a large number of invalid test cases. Existing studies have indicated that test cases triggering historical compiler bugs can assist in software testing. Our investigation into Rust compiler bug issues supports this observation. Inspired by existing work and our empirical research, we introduce a bracket-based masking and filling strategy called clozeMask. The clozeMask strategy involves extracting test code from historical issue reports, identifying and masking code snippets with specific structures, and using an LLM to fill in the masked portions for synthesizing new test programs. This approach harnesses the generative capabilities of LLMs while retaining the ability to trigger Rust compiler bugs. It enables comprehensive testing of the compiler's behavior, particularly exploring edge cases. We implemented our approach as a prototype ClozeMaster. ClozeMaster has identified 27 confirmed bugs for rustc and mrustc, of which 10 have been fixed by developers. Furthermore, our experimental results indicate that ClozeMaster outperforms existing fuzzers in terms of code coverage and effectiveness.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Fuzz4All: Universal Fuzzing with Large Language Models 引用了 InCoder: A Generative Model for Code Infilling and Synthesis
- Fuzz4All: Universal Fuzzing with Large Language Models 引用了 Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models
- Fuzz4All: Universal Fuzzing with Large Language Models 引用了 Language Models are Few-Shot Learners
- InCoder: A Generative Model for Code Infilling and Synthesis 引用了 Language Models are Few-Shot Learners
- Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models 引用了 InCoder: A Generative Model for Code Infilling and Synthesis
- Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models 引用了 Language Models are Few-Shot Learners
- Using a Sledgehammer to Crack a Nut? Revisiting Automated Compiler Fault Isolation 引用了 Unveiling Compiler Faults via Attribute-Guided Compilation Space Exploration
- FeatureFuzz: Treating Bug-prone Features as Core Primitives for Compiler Fuzzing 引用了 Fuzz4All: Universal Fuzzing with Large Language Models
引用它的顶会 Paper4
- Unveiling Compiler Faults via Attribute-Guided Compilation Space ExplorationJiangchang Wu, Yibiao Yang, Maolin Sun, Yuming ZhouUSENIX ATC 2025 · 6 次引用
- Using a Sledgehammer to Crack a Nut? Revisiting Automated Compiler Fault IsolationYibiao Yang, Qingyang Li, Maolin Sun, Jiangchang Wu 等ICSE 2026 · 1 次引用
- FeatureFuzz: Treating Bug-prone Features as Core Primitives for Compiler FuzzingXingbang He, Yuanwei Chen, Hao Wu, Jikang Zhang 等CCS 2026
- RICE: Harnessing LLMs and Historical Issues to Discover Internal Rust Compiler ErrorsLangyi Lu, Wei You, Bin Liang, Jianjun HuangISSTA 2026
它引用的 Paper23
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- CodeT5+: Open Code Large Language Models for Code Understanding and GenerationYue Wang, Hung Le, Akhilesh Gotmare, Nghi D. Q. Bui 等EMNLP 2023 · 339 次引用
- Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language ModelsYinlin Deng, Chunqiu Steven Xia, Haoran Peng, Chenyuan Yang 等ISSTA 2023 · 253 次引用
- Fuzz4All: Universal Fuzzing with Large Language ModelsChunqiu Steven Xia, Matteo Paltenghi, Jia Le Tian, Michael Pradel 等ICSE 2024 · 155 次引用
- InCoder: A Generative Model for Code Infilling and SynthesisDaniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang 等ICLR 2023 · 140 次引用
相关 Paper
- Rug: Turbo Llm for Rust Unit Test GenerationXiang Cheng, Fan Sang, Yizhuo Zhai, Xiaokuan Zhang 等ICSE 2025 · 6 次引用
- Validating Rust Compilers with Trait-Type Constraint GraphXin Lai, Ming Wen, Xiaofei Liao, Hai JinSOSP 2026
- HarnessLLM: Rust Verification Harness Generation with Large Language ModelsMinghua Wang, Yuwei Liu, Lin HuangICSE 2026
- deepSURF: Detecting Memory Safety Vulnerabilities in Rust Through Fuzzing LLM-Augmented HarnessesGeorgios C. Androutsopoulos, Antonio BianchiS&P 2026 · 5 次引用
- PALM: Synergizing Program Analysis and LLMs to Enhance Rust Unit Test CoverageBei Chu, Yang Feng, Kui Liu, Hange Shi 等ASE 2025 · 3 次引用
