一句话:从失败相关的内存访问模式推断锁策略,自动修复 Java 并发缺陷。
多线程程序的并发缺陷往往是 heisenbug,仅在特定调度下出现,难以稳定复现与修复。本文提出自动修复并发缺陷的方法:系统地从引发失败的内存访问模式中推断锁策略。方法先自动识别与缺陷显现相关的内存访问模式,进而推测程序意图的加锁策略,再按该策略修改程序,使这些引发失败的访问模式不可能发生。作者在支持 Java 的工具 PFix 中实现了该方法,并在 23 个并发缺陷上评估,成功自动修复 19 个;而最先进的 Java 并发缺陷修复工具 Grail 仅能正确修复 3 个,显示出显著优势。
Concurrency bugs of a multi-threaded program may only manifest with certain scheduling, i.e., they are heisenbugs which are observed only from time to time if we execute the same program with the same input multiple times. They are notoriously hard to fix. In this work, we propose an approach to automatically fix concurrency bugs. Compared to previous approaches, our key idea is to systematically fix concurrency bugs by inferring locking policies from failure inducing memory-access patterns. That is, we automatically identify memory-access patterns which are correlated with the manifestation of the bug, and then conjecture what is the intended locking policy of the program. Afterwards, we fix the program by implementing the locking policy so that the failure inducing memory-access patterns are made impossible. We have implemented our approach in a toolkit called PFix which supports Java programs. We applied PFix to a set of 23 concurrency bugs and are able to automatically fix 19 of them. In comparison, Grail which is the state-of-the-art tool for fixing concurrency bugs in Java programs can only fix 3 of them correctly.
DOI 原文 ·
@inproceedings{paperbot4753,
title = {PFix: fixing concurrency bugs based on memory access patterns},
author = {Huarui Lin and Zan Wang and Shuang Liu and Jun Sun and Dongdi Zhang and Guangning Wei},
booktitle = {ASE},
year = {2018},
doi = {10.1145/3238147.3238198}
}