基于Petri网的Rust程序并发缺陷自动检测方法
Petri Nets-based Methods on Automatically Detecting for Concurrency Bugs in Rust Programs
AI总结:
本文提出一种基于Petri网的Rust并发缺陷检测方法,通过语法保持的程序转换、上下文感知状态压缩和可达性分析,结合流敏感指针分析,在基准测试中显著降低了误报和漏报,并实现了比动态工具Miri更快的验证速度。
摘要:
Rust的内存安全保证,尤其是所有权和生命周期系统,推动了其广泛采用。然而,Rust程序中仍然会出现并发缺陷,现有的检测方法存在显著局限:静态分析器存在上下文不敏感和高误报的问题,而动态方法由于指数级路径探索导致运行时开销过高。本文提出了一种基于Petri网的方法,用于高效、精确地检测Rust并发缺陷。该方法建立在三个支柱之上:(1)针对目标缺陷类别定制的保持语法的程序到Petri网转换;(2)通过上下文感知切片实现保持语义的状态压缩;(3)通过高效的Petri网可达性分析进行缺陷检测。其核心创新在于,在Petri网结构中对Rust的所有权语义和同步原语进行严格的、控制流驱动的建模,并将数据操作表示为令牌移动。集成的指针分析在转换过程中自动识别别名。在标准Rust并发基准上的实验表明,我们的方法优于最先进的方法LockBud和Miri,这两个工具都是用于检测Rust程序并发缺陷的工具。与LockBud相比,我们的方法通过精确的流敏感指针分析,将误报降低了35.7%,漏报降低了28.3%。与作为动态分析工具的Miri相比,尽管Miri可以获得相同的检测结果,但由于我们的方法采用了状态缩减算法,验证速度提高了100%。
英文摘要:
Rust's memory safety guarantees, notably ownership and lifetime systems, have driven its widespread adoption. Concurrency bugs still occur in Rust programs, and existing detection approaches exhibit significant limitations: static analyzers suffer from context insensitivity and high false positives, while dynamic methods incur prohibitive runtime costs due to exponential path exploration. This paper presents a Petri net-based method for efficient, precise detection of Rust concurrency bugs. The method rests on three pillars: (1) A syntax-preserving program-to-Petri-net transformation tailored for target bug classes; (2) Semantics-preserving state compression via context-aware slicing; (3) Bug detection through efficient Petri net reachability analysis. The core innovation is its rigorous, control-flow-driven modeling of Rust's ownership semantics and synchronization primitives within the Petri net structure, with data operations represented as token movements. Integrated pointer analysis automates alias identification during transformation. Experiments on standard Rust concurrency benchmarks demonstrate that our method outperforms the state-of-the-art methods LockBud and Miri that are both tools of detecting concurrency bugs of Rust programs. Compared to LockBud, our approach reduces false positives by 35.7\% and false negatives by 28.3\% , which is obtained through our precise flow-sensitive pointer analysis. Compared with Miri that is a dynamic analysis tool, although Miri can obtain the same detection results, our method achieves 100% faster verification speed since our method takes a state reduce algorithm.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。