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

DeepRace:通过深度学习发现数据竞赛漏洞

DeepRace: Finding Data Race Bugs via Deep Learning

Ali Tehrani, Mohammed Khaleel, Reza Akbari, Ali Jannesari

摘要:

随着多核硬件的普及,并行程序已经变得无处不在。这些程序都有自己的bug类型,称为并发bug,其中,数据竞争bug在过去几十年中一直是研究人员关注的焦点。事实上,检测数据竞争是一项非常具有挑战性和重要的任务。在这一领域有几条研究路径,设计和使用了许多复杂的工具,专注于在文件级别检测数据竞争。在本文中,我们提出了DeepRace,这是一种在源代码中检测数据竞争的新方法。我们构建了一个深度神经网络模型来发现数据竞争,而不是手动创建数据竞争检测器。我们的模型使用了一个单层卷积神经网络(CNN)与不同的窗口大小,以找到数据竞争的方法。然后,我们采用具有全局平均池化的类激活映射函数来提取最后一个卷积层的权重,并将其与输入源代码反向传播,以提取具有数据竞争的代码行。因此,DeepRace模型可以检测文件和代码行级别的数据竞争错误。此外,我们注意到DeepRace成功地检测到文件不同位置的几行错误代码。我们测试了模型与OpenMP和POSIX源代码数据集,分别由超过5000和8000个源代码文件。我们能够成功地对有错误的源代码文件进行分类,准确率在81%到86%之间。我们还测量了在代码行级别检测和可视化数据竞争的性能,我们的模型取得了可喜的成果。我们只有少量的假阳性和假阳性,范围从1到10。此外,我们使用交集的联合来衡量错误代码行的准确性,我们的模型取得了66%的令人鼓舞的结果。

英文摘要:

With the proliferation of multi-core hardware, parallel programs have become ubiquitous. These programs have their own type of bugs known as concurrency bugs and among them, data race bugs have been mostly in the focus of researchers over the past decades. In fact, detecting data races is a very challenging and important task. There have been several research paths in this area with many sophisticated tools designed and utilized that focus on detecting data race at the file level. In this paper, we propose DeepRace, a novel approach toward detecting data races in the source code. We build a deep neural network model to find data races instead of creating a data race detector manually. Our model uses a one-layer convolutional neural network (CNN) with different window size to find data races method. Then we adopt the class activation map function with global average pooling to extract the weights of the last convolutional layer and backpropagate it with the input source code to extract the line of codes with a data race. Thus, the DeepRace model can detect the data race bugs on a file and line of code level. In addition, we noticed that DeepRace successfully detects several buggy lines of code at different locations of the file. We tested the model with OpenMP and POSIX source code datasets which consist of more than 5000 and 8000 source code files respectively. We were able to successfully classify buggy source code files and achieve accuracies ranging from 81% and 86%. We also measured the performance of detecting and visualizing the data race at the line of code levels and our model achieved promising results. We only had a small number of false positives and false, ranging from 1 to 10. Furthermore, we used the intersection of union to measure the accuracy of the buggy lines of code, our model achieved promising results of 66 percent.

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

↑