首页 | 本学科首页   官方微博 | 高级检索  
     

高精度的大规模程序数据竞争检测方法
引用本文:高凤娟,王豫,周金果,徐安孜,王林章,吴荣鑫,张川,苏振东.高精度的大规模程序数据竞争检测方法[J].软件学报,2021,32(7):2039-2055.
作者姓名:高凤娟  王豫  周金果  徐安孜  王林章  吴荣鑫  张川  苏振东
作者单位:计算机软件新技术国家重点实验室(南京大学), 江苏 南京 210023;蚂蚁集团, 广东 深圳;厦门大学 信息学院 国家示范性软件学院, 福建 厦门 361005;香港科技大学 计算机科学与工程系, 香港;苏黎世联邦理工学院 计算机科学系, 瑞士
基金项目:国家自然科学基金(62032010)
摘    要:随着技术的不断发展,软件系统的非确定性(Uncertainty)不断增强,数据竞争是并发系统这一类典型的非确定性软件系统中常见的缺陷.尽管数据竞争静态检测近年来取得了巨大进展,但其面临的重要问题仍然存在.先前的静态技术要么以分析精度为代价达到高扩展性,要么由于高精度分析而导致可扩展性问题.本文提出一种解决上述矛盾的分段分析方法——GUARD.它首先基于程序值流进行轻量级上下文敏感的数据访问分析,以识别出候选的数据竞争子路径而非完整的程序路径.接下来,进行可能并行执行(May-Happen-in-Parallel,即MHP)分析来确定程序中的两个数据访问操作是否可能会同时执行.MHP分析基于线程流图(TFG)将线程信息进行编码以便于高效地查询各个子路径之间的并发关系.最后,对于每条存在MHP数据访问的子路径,进行重量级路径敏感分析以确定数据竞争路径的可行性.针对12个开源项目的实验评估显示GUARD能够在1870秒内完成对130万行代码的工业规模项目的检测,且平均误报率为16.0%.此外GUARD的分析速度更快,比现有的前沿技术平均快了6.08倍并且显著降低误报率.除此之外,GUARD在其中还发现了12个数据竞争漏洞.我们将它们全部报告给了开发者,其中8个已得到了确认.

关 键 词:数据竞争  MHP分析  静态分析
收稿时间:2020/9/5 0:00:00
修稿时间:2020/10/26 0:00:00

High-precision Data Race Detection Method for Large Scale Programs
GAO Feng-Juan,WANG Yu,ZHOU Jin-Guo,XU An-Zi,WANG Lin-Zhang,WU Rong-Xin,ZHANG Charles,SU Zhen-Dong.High-precision Data Race Detection Method for Large Scale Programs[J].Journal of Software,2021,32(7):2039-2055.
Authors:GAO Feng-Juan  WANG Yu  ZHOU Jin-Guo  XU An-Zi  WANG Lin-Zhang  WU Rong-Xin  ZHANG Charles  SU Zhen-Dong
Affiliation:State Key Laboratory for Novel Software Technology (Nanjing University), Nanjing 210023, China;ANT Group, Shenzheng, China;School of Informatics, National Demonstrative Software School (Xiamen University), Xiamen 361005, China;Department of Computer Science and Engineering (The Hongkong University of Science and Technology), Hongkong, China; Department of Computer Science (ETH Zurich), Zürich, Switzerland
Abstract:With the development of techniques, the uncertainty in software systems are 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. In this paper, we present GUARD, a staged approach to resolve this paradox. It first 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, we employ May-Happen-in-Parallel (MHP) analysis to 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), that encodes thread information to query MHP relationship of the subpaths. Finally, for each subpath whose two data accesses are MHP, we apply heavyweight path-sensitive analysis to verify the feasibility of the data races. The evaluation demonstrates that GUARD can finish checking industrial-sized projects, up to 1.3MLoC, in 1,870 seconds with an average false positive rate of 16.0%. Moreover, GUARD is faster than 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. We report all of them to the developers and 8 of them have been confirmed.
Keywords:data race  MHP analysis  static analysis
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号