paperbot · PL 论文追踪

全部论文 待读 收藏

P2 NodeRT: Detecting Races in Node.js Applications Practically

NodeRT:实用地检测 Node.js 应用中的竞态
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 1/10 · 该论文研究 Node.js 事件处理竞态的实用化动态检测(异步调用树 + 三阶段检测降低误报与开销),属于并发动态分析,与用户关注的 PL↔AI(LLM/Agent 程序静态分析、Agent 改进分析)、浮点程序分析与贝叶斯程序分析均无交集;既不涉及 LLM/Agent,也不是静态分析或浮点/贝叶斯方法。引用 2 inbox
Jingyao Zhou, Lei Xu, Gongzheng Lu, Weifeng Zhang, Xiangyu Zhang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 NodeRT,通过异步调用树与三阶段动态检测,高效发现 Node.js 事件处理竞态并降低误报。

Node.js 因其并发支持而广泛使用,但事件处理器执行顺序不确定会导致竞态,引发运行时故障。现有 NRace 先构建 happens-before 图,再用重量级 BFS 查询资源操作可达性,开销过大,难以适用于真实测试流程。本文提出更实用的 Node.js 动态竞态检测方法 NodeRT,将检测分为轨迹收集、竞态候选检测和误报消除三阶段。轨迹收集阶段构建部分 HB 图,称为异步调用树 ACTree,以高效查询事件处理器间可达性;候选检测阶段在 ACTree 上排除多数非竞态事件处理器;误报消除阶段利用由 HB 规则和资源特征导出的匹配规则过滤误报。实验表明,NodeRT 检出真实应用中全部已知竞态和 9 个未知有害竞态,而 NRace 仅检出其中 3 个,且 NodeRT 平均耗时少 64 倍,显著降低开销,便于集成到实际测试流程。

问题
Node.js 事件处理器的非确定执行顺序会引发竞态,而现有 NRace 基于 HB 图和 BFS 可达性查询,开销过高,难以用于真实应用测试。
方法
NodeRT 简化 HB 关系规则,分三阶段检测:采集轨迹并构建部分 HB 图 ACTree;在 ACTree 上检测竞态候选;利用匹配规则消除误报。
评估
在真实应用中,NodeRT 检出全部已知竞态和 9 个未知有害竞态,而 NRace 仅检出 3 个未知有害竞态;NodeRT 平均耗时少 64 倍,显著降低开销。
原文摘要(Abstract)

Node.js has become one of the most popular development platforms due to its superior concurrency support. However, races induced by the nondeterministic execution order of event handlers may occur in Node.js applications, causing serious runtime failures. The state-of-the-art Node.js race detector NRace builds a happens-before (HB) graph before detection with a set of HB relation rules. In detection, NRace utilizes a heavy-weight BFS-based algorithm to query the reachability between resource operations, which introduces substantial overhead in practice, causing NRace inapplicable to real-world Node.js application test processes. This paper proposes a more practical Node.js dynamic race detection approach called NodeRT (Node.js Race Tracker). To reduce unnecessary overhead, NodeRT simplifies the HB relation rules, and divides the detection into three stages: trace collection stage, race candidate detection stage, and false positive removal stage. In the trace collection stage, NodeRT constructs a partial HB graph called asynchronous call tree (ACTree), enabling efficient reachability queries between event handlers. In the race candidate detection stage, NodeRT performs detection on the ACTree, which effectively eliminates most non-racing event handlers and outputs race candidates. In the false positive removal stage, NodeRT utilizes matching rules derived from HB relation rules and features of resources to reduce false positives in the race candidates. In experiments, NodeRT detects all known races and 9 unknown harmful races in real-world applications, whereas NRace only detects 3 of the unknown harmful races, with 64× more time consumption on average. Compared with NRace, NodeRT significantly reduces the overhead, making it practical to be integrated into real-world test processes.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{Zhou0LZ023,
  title = {NodeRT: Detecting Races in Node.js Applications Practically},
  author = {Jingyao Zhou and Lei Xu and Gongzheng Lu and Weifeng Zhang and Xiangyu Zhang},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598139}
}