arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.03262cs.SE
收藏

PanicFI:一个用于修复真实世界Rust程序中panic缺陷的基础设施

PanicFI: An Infrastructure for Fixing Panic Bugs in Real-World Rust Programs

Yunbo Ni, Yang Feng, Zixi Liu, Runtao Chen, Baowen Xu

AI总结:

针对Rust程序panic缺陷修复难的问题,提出PanicFI基础设施,构建含102个真实缺陷的Panic4R数据集,挖掘Rust特有修复模式,开发首款自动化修复工具PanicKiller,已修复28个开源缺陷,验证了模式有效性。

摘要:

Rust编程语言凭借其强大的安全特性和内存管理能力受到了广泛关注。尽管Rust能保证内存安全,但Rust程序仍会出现无法管控的运行时错误,即panic错误。值得注意的是,空指针解引用这类在其他语言中普遍存在的传统内存问题,由于Rust严格的所有权规则,在Rust中被触发的概率更低。然而,Rust的panic缺陷源于该语言严苛的安全与所有权范式,其独特性带来了独特的挑战。Rust自带的编译器rustc中,超过半数的缺陷都由panic错误导致的崩溃引起。但修复Rust panic缺陷难度大、耗费精力多,因为Rust语言的设计与特性使得现有的修复模式无法直接套用。因此,构建包含数据集、修复模式和自动化修复工具在内的基础支撑设施至关重要且迫在眉睫。本文提出了一套综合性基础设施PanicFI,旨在为理解Rust panic缺陷、开发自动化修复技术提供支持。在PanicFI中,我们构建了Panic4R数据集,包含来自下载量最高的500个开源crate的102个真实panic缺陷及其修复方案。随后,通过分析Rust编译器的实现,我们识别出了Rust特有的panic缺陷修复模式,为补丁生成提供了思路与指导。此外,我们还开发了首款Rust panic缺陷自动化修复工具PanicKiller,目前已助力修复开源项目中的28个panic缺陷。PanicKiller的实用性与高效性印证了PanicFI中挖掘出的修复模式的有效性。

英文摘要:

The Rust programming language has garnered significant attention due to its robust safety features and memory management capabilities. Despite its guaranteed memory safety, Rust programs suffer from runtime errors that are unmanageable, i.e., panic errors. Notably, traditional memory issues such as null pointer dereferences, which are prevalent in other languages, are less likely to be triggered in Rust due to its strict ownership rules. However, the unique nature of Rust's panic bugs, which arise from the language's stringent safety and ownership paradigms, presents a distinct challenge. Over half of the bugs in rustc, Rust's own compiler, are attributable to crash stemming from panic errors. However, addressing Rust panic bugs is challenging and requires significant effort, as existing fix patterns are not directly applicable due to the design and feature of Rust language.Therefore, developing foundational infrastructure, including datasets, fixing patterns, and automated repair tools, is both critical and urgent. This paper introduces a comprehensive infrastructure, namely PanicFI, aimed at providing supports for understanding Rust panic bugs and developing automated techniques. In PanicFI, we construct a dataset, Panic4R, comprising 102 real panic bugs and their fixes from the top 500 most-downloaded open-source crates.Then, through an analysis of the Rust compiler implementation , we identify Rust-specific patterns for fixing panic bugs, providing insights and guidance for generating patches. Moreover, we develop PanicKiller, the first automated tool for fixing Rust panic bugs, which has already contributed to the resolution of 28 panic bugs in open-source projects.The practicality and efficiency of PanicKiller confirm the effectiveness of the patterns mined within PanicFI.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑