arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.20127cs.PL
收藏

使用 O(1) 采样的动态竞争检测

Dynamic Race Detection With O(1) Samples

Mosaad Al Thokair, Minjian Zhang, Umang Mathur, Mahesh Viswanathan

AI总结:

提出首个基于采样的亚线性时间动态数据竞争检测算法,利用常数级事件处理在保证无误报的同时显著降低运行时间并保持高检测率。

摘要:

基于 Happens before 的动态分析由于没有误报,是检测大规模软件项目中数据竞争的首选技术。然而,此类分析代价高昂,因为它们在每个事件中都采用昂贵的向量时钟更新,导致其仅适用于内部测试。在本文中,我们提出了一种基于采样的随机化竞争检测器,即使在最坏情况下,它也仅处理输入轨迹中常数数量的事件。这是第一个亚线性时间(即运行时间为 o(n),其中 n 是轨迹长度)的动态竞争检测算法;以往基于采样的方法(如 Pacer)运行在线性时间(即 O(n))。我们的算法是 HB 竞争检测的属性测试器——它是可靠的,即从不报告任何误报,并且在距离任何无竞争轨迹的汉明距离很远的轨迹上,该算法能以高概率检测出 HB 竞争。我们对算法的实验评估及其与最先进的确定性和基于采样的竞争检测器的比较表明,该算法确实具有极低的运行时间,并且能相当频繁地检测到竞争。

英文摘要:

Happens before-based dynamic analysis is the go-to technique for detecting data races in large scale software projects due to the absence of false positive reports. However, such analyses are expensive since they employ expensive vector clock updates at each event, rendering them usable only for in-house testing. In this paper, we present a sampling-based, randomized race detector that processes only constantly many events of the input trace even in the worst case. This is the first sub-linear time (i.e., running in o(n) time where n is the length of the trace) dynamic race detection algorithm; previous sampling based approaches like Pacer run in linear time (i.e., O(n)). Our algorithm is a property tester for HB-race detection -- it is sound in that it never reports any false positive, and on traces that are far, with respect to hamming distance, from any race-free trace, the algorithm detects an HB-race with high probability. Our experimental evaluation of the algorithm and its comparison with state-of-the-art deterministic and sampling based race detectors shows that the algorithm does indeed have significantly low running time, and detects races quite often.

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

↑