[论文解读] A Survey of Modern Compiler Fuzzing
本综述全面分析了现代编译器模糊测试技术,重点聚焦于测试程序生成与测试预言设计,以检测编译器中的错误。该研究综合了58项关于主流及领域特定编译器的研究,识别出在有效性、多样性、可扩展性及模糊测试工具评估方面的主要挑战与未来研究方向。
Most software that runs on computers undergoes processing by compilers. Since compilers constitute the fundamental infrastructure of software development, their correctness is paramount. Over the years, researchers have invested in analyzing, understanding, and characterizing the bug features over mainstream compilers. These studies have demonstrated that compilers correctness requires greater research attention, and they also pave the way for compiler fuzzing. To improve compilers correctness, researchers have proposed numerous compiler fuzzing techniques. These techniques were initially developed for testing traditional compilers such as GCC/LLVM and have since been generalized to test various newly developed, domain-specific compilers, such as graphics shader compilers and deep learning (DL) compilers. In this survey, we provide a comprehensive summary of the research efforts for understanding and addressing compilers defects. Specifically, this survey mainly covers two aspects. First, it covers researchers investigation and expertise on compilers bugs, such as their symptoms and root causes. The compiler bug studies cover GCC/LLVM, JVM compilers, and DL compilers. In addition, it covers researchers efforts in designing fuzzing techniques, including constructing test programs and designing test oracles. Besides discussing the existing work, this survey outlines several open challenges and highlights research opportunities.
研究动机与目标
- 系统分析现代及领域特定编译器模糊测试的最新技术状态。
- 识别生成有效且多样化测试程序以触发潜在编译器错误的核心挑战。
- 考察创新的测试预言设计,以检测编译二进制文件中细微的语义错误。
- 突出当前编译器模糊测试工具在可扩展性、泛化能力及评估框架方面存在的开放问题。
- 通过概述编译器正确性与模糊测试方法论的未来研究机遇,为研究人员和实践者提供指导。
提出的方法
- 调研58篇高质量的编译器模糊测试研究论文,重点关注GCC、LLVM、JVM及领域特定编译器(如DL和图形着色器编译器)。
- 对测试程序生成技术进行分类与分析,包括基于语法的生成(如Csmith)、基于变异的方法(如EMI、Athena)以及大语言模型辅助的合成。
- 评估检测源代码与编译代码之间语义差异的测试预言机制,包括基于覆盖率的预言与语义感知预言。
- 评估代码覆盖率与基于特性的覆盖率等多样性度量,以量化测试程序的多样性与有效性。
- 考察现有工具在可扩展性方面的挑战,包括硬编码的语法规则以及缺乏模块化设计以实现跨编译器可移植性。
- 审查评估实践,并倡导建立标准化基准与共识评估协议,以实现对新型模糊测试技术的公平比较。
实验结果
研究问题
- RQ1在为现代编译器生成有效且多样化测试程序方面,主要挑战是什么?
- RQ2现有测试预言如何检测编译二进制文件中细微的、语义保持不变的错误?
- RQ3当前编译器模糊测试工具在不同编译器组件与编程语言之间,其可扩展性与泛化能力存在哪些局限性?
- RQ4如何标准化编译器模糊测试的评估框架,以确保可重现性与公平比较?
- RQ5大语言模型在减少语法学习与测试程序合成中的手动工作量方面,可发挥何种作用?
主要发现
- 编译器模糊测试在发现关键错误方面非常有效,包括导致断言失败、段错误以及对格式正确程序的错误优化。
- 许多编译器错误源于C等语言中的未定义行为,避免此类构造的模糊测试工具在测试生成方面表现出更高的可靠性。
- 基于覆盖率的测试与基于特性的多样性度量在提高触发潜在编译器错误的可能性方面非常有效。
- 基于变异的工具(如Athena与EMI)在多样性与错误发现能力方面显著优于早期方法,尤其在引入反馈驱动策略后表现更佳。
- 当前工具因硬编码的语法规则与缺乏模块化设计,导致可扩展性差,将工具移植到新编译器需耗费大量时间。
- 尽管大语言模型在生成有效程序与学习语言语法规则方面展现出潜力,但其在生成复杂、类型安全且语义正确的程序方面的能力仍有限,需进一步研究。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。