paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros Generation

Rust-twins:通过程序变异与双宏生成实现 Rust 编译器自动测试
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 1/10 · 论文聚焦 Rust 编译器测试(程序变异与双宏生成检测崩溃/误编译),属于编译器测试与程序变异,不涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户研究方向基本无关。引用 6 inbox
Wenzhang Yang, Cuifeng Gao, Xiaoyuan Liu, Yuekang Li, Yinxing Xue
crossref: 2026-09-12

AI 速览

一句话:提出 Rust-twins,用程序变异与双宏生成构造语义等价的程序孪生体,为 rustc 同时检测崩溃与误编译。

Rust 因内存安全与众多高级特性被广泛用于系统软件,而 rustc 作为其唯一实现,其可靠性与健壮性至关重要。编译器测试面临两大困难:严格的内存安全机制使生成合法且多样的 Rust 程序十分困难;现有工作主要关注触发崩溃类错误,忽略了编译结果错误(miscompilation),且由于 Rust 编译器没有多个实现可供对照,缺少测试预言。为此,作者提出 Rust-twins,将程序变异与双宏生成技术结合,构造语义等价、行为应当一致的 Rust 程序对,并以两者之间的差异作为测试预言,从而在无需第二实现的前提下检测误编译,同时兼顾崩溃类缺陷。该工作为自动测试 rustc、覆盖崩溃与误编译两类问题提供了可行途径。

问题
rustc 是 Rust 的唯一实现,其可靠性至关重要;但严格的内存安全机制使合法且多样的 Rust 测试程序难以生成,且缺少第二实现作为测试预言,现有工作只关注崩溃类错误而忽略误编译。
方法
通过程序变异并借助双宏生成构造语义等价(预期行为一致)的 Rust 程序对,以程序对的差异作为测试预言来检测误编译,同时触发崩溃类缺陷。
评估
以真实 Rust 编译器 rustc 为对象开展自动测试,验证所生成的程序对能否暴露崩溃与误编译缺陷;摘要未报告具体实验数据。
原文摘要(Abstract)

Rust is a relatively new programming language known for its memory safety and numerous advanced features. It has been widely used in system software in recent years. Thus, ensuring the reliability and robustness of the only implementation of the Rust compiler, rustc, is critical. However, compiler testing, as one of the most effective techniques to detect bugs, faces difficulties in generating valid Rust programs with sufficient diversity due to its stringent memory safety mechanisms. Furthermore, existing research primarily focuses on testing rustc to trigger crash errors, neglecting incorrect compilation results - miscompilation. Detecting miscompilation remains a challenge in the absence of multiple implementations of the Rust compiler to serve as a test oracle.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8278,
  title = {Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros Generation},
  author = {Wenzhang Yang and Cuifeng Gao and Xiaoyuan Liu and Yuekang Li and Yinxing Xue},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695059}
}