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