| 引用本文: | 高凤娟,王豫,周金果,徐安孜,王林章,吴荣鑫,张川,苏振东.高精度的大规模程序数据竞争检测方法.软件学报,2021,32(7):2039-2055 |
| |
|
| |
|
|
| 本文已被:浏览 3556次 下载 7445次 |
 码上扫一扫! |
|
|
| 高精度的大规模程序数据竞争检测方法 |
|
高凤娟1, 王豫1, 周金果2, 徐安孜1, 王林章1, 吴荣鑫3, 张川4, 苏振东5,6
|
|
1.计算机软件新技术国家重点实验室(南京大学), 江苏 南京 210023;2.蚂蚁集团, 广东 深圳 518000;3.厦门大学 信息学院, 福建 厦门 361005;4.Department of Computer Science and Engineering, The Hongkong University of Science and Technology, Hongkong, China;5.Department of Computer Science (ETH Zurich), Zü6.rich, Switzerland
|
|
| 摘要: |
| 随着技术的不断发展,软件系统的非确定性(uncertainty)不断增强,数据竞争是并发系统这一类典型的非确定性软件系统中常见的缺陷.尽管数据竞争静态检测近年来取得了巨大进展,但其面临的重要问题仍然存在.先前的静态技术要么以分析精度为代价达到高扩展性,要么由于高精度分析而导致可扩展性问题.提出一种解决上述矛盾的分段分析方法——GUARD.它首先基于程序值流进行轻量级上下文敏感的数据访问分析,以识别出候选的数据竞争子路径而非完整的程序路径.接下来,进行可能并行执行(may-happen-in-parallel,即MHP)分析来确定程序中的两个数据访问操作是否可能会同时执行.MHP分析基于线程流图(TFG)将线程信息进行编码以便于高效地查询各个子路径之间的并发关系.最后,对于每条存在MHP数据访问的子路径,进行重量级路径敏感分析以确定数据竞争路径的可行性.针对12个开源项目的实验评估显示,GUARD能够在1 870s内完成对130万行代码的工业规模项目的检测,且平均误报率为16.0%.此外,GUARD的分析速度更快,比现有的前沿技术平均快了6.08倍,并且显著降低了误报率.除此之外,GUARD在其中还发现了12个数据竞争漏洞.将它们全部报告给了开发者,其中8个已得到了确认. |
| 关键词: 数据竞争 MHP分析 静态分析 |
| DOI:10.13328/j.cnki.jos.006260 |
| 分类号: |
| 基金项目:国家自然科学基金(62032010) |
|
| High-precision Data Race Detection Method for Large Scale Programs |
|
GAO Feng-Juan1, WANG Yu1, ZHOU Jin-Guo2, XU An-Zi1, WANG Lin-Zhang1, WU Rong-Xin3, ZHANG Charles4, SU Zhen-Dong5,6
|
|
1.State Key Laboratory for Novel Software Technology(Nanjing University), Nanjing 210023, China;2.ANT Group, Shenzheng 518000, China;3.School of Informatics, National Demonstrative Software School(Xiamen University), Xiamen 361005, China;4.Department of Computer Science and Engineering, The Hongkong University of Science and Technology, Hongkong, China;5.Department of Computer Science(ETH Zurich), Zü6.rich, Switzerland
|
| Abstract: |
| With the development of techniques, the uncertainty in software systems is continuously increasing. Data race is a typical bug in current programs, which is a classic type of uncertainty programs. Despite significant progress in recent years, the important problem of practical static race detection remains open. Previous static techniques either suffer from a high false positive rate due to the compromise of precision, or scalability issues caused by a highly precise analysis. This paper presents GUARD, a staged approach to resolve this paradox. First, it performs a lightweight context-sensitive data access analysis, based on the value flow of a program, to identify the candidate data race subpaths instead of the whole program paths. Second, may-happen-in-parallel (MHP) analysis is employedto identify whether two data accesses in a program may execute concurrently. This stage is scalable, due to the design of the thread flow graph (TFG), which encodes thread information to query MHP relationship of the subpaths. Finally, for each subpath whose two data accesses are MHP, the heavyweight path-sensitive analysis is appliedto verify the feasibility of the data races. The evaluation demonstrates that GUARD can finish checking industrial-sized projects, up to 1.3MLoC, in 1 870s with an average false positive rate of 16.0%. Moreover, GUARD is faster than the state-of-the-art techniques with the average speedup 6.08X and significantly fewer false positives. Besides, GUARD has found 12 new race bugs in real-world programs. All of them are reportedtothe developers and 8 of them have been confirmed. |
| Key words: data race MHP analysis static analysis |
|
|
|
|