Sound Dynamic Deadlock Prediction in Linear Time

被引:5
作者
Tunc, Hünkar Can [1 ]
Mathur, Umang [2 ]
Pavlogiannis, Andreas [1 ]
Viswanathan, Mahesh [3 ]
机构
[1] Aarhus Univ, Aarhus, Denmark
[2] Natl Univ Singapore, Singapore, Singapore
[3] Univ Illinois, Champaign, IL USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2023年 / 7卷 / PLDI期
关键词
concurrency; runtime analyses; predictive analyses; POTENTIAL DEADLOCKS; COMPLEXITY;
D O I
10.1145/3591291
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Deadlocks are one of the most notorious concurrency bugs, and significant research has focused on detecting them efficiently. Dynamic predictive analyses work by observing concurrent executions, and reason about alternative interleavings that can witness concurrency bugs. Such techniques offer scalability and sound bug reports, and have emerged as an effective approach for concurrency bug detection, such as data races. Effective dynamic deadlock prediction, however, has proven a challenging task, as no deadlock predictor currently meets the requirements of soundness, high-precision, and efficiency. In this paper, we first formally establish that this tradeoff is unavoidable, by showing that (a) sound and complete deadlock prediction is intractable, in general, and (b) even the seemingly simpler task of determining the presence of potential deadlocks, which often serve as unsound witnesses for actual predictable deadlocks, is intractable. The main contribution of this work is a new class of predictable deadlocks, called sync(hronization)preserving deadlocks. Informally, these are deadlocks that can be predicted by reordering the observed execution while preserving the relative order of conflicting critical sections. We present two algorithms for sound deadlock prediction based on this notion. Our first algorithm SPDOffline detects all sync-preserving deadlocks, with running time that is linear per abstract deadlock pattern, a novel notion also introduced in this work. Our second algorithm SPDOnline predicts all sync-preserving deadlocks that involve two threads in a strictly online fashion, runs in overall linear time, and is better suited for a runtime monitoring setting. We implemented both our algorithms and evaluated their ability to perform offline and online deadlockprediction on a large dataset of standard benchmarks. Our results indicate that our new notion of syncpreserving deadlocks is highly effective, as (i) it can characterize the vast majority of deadlocks and (ii) it can be detected using an online, sound, complete and highly efficient algorithm.
引用
收藏
页码:1733 / 1758
页数:26
相关论文
共 61 条
  • [1] Agarwal R, 2006, LECT NOTES COMPUT SC, V3875, P191
  • [2] Bensalem S., 2006, PADTAD'06, P41
  • [3] Bensalem S, 2006, LECT NOTES COMPUT SC, V3875, P208
  • [4] Biswas S, 2014, ACM SIGPLAN NOTICES, V49, P28, DOI [10.1145/2666356.2594323, 10.1145/2594291.2594323]
  • [5] The DaCapo benchmarks: Java']Java benchmarking development and analysis
    Blackburn, Stephen M.
    Garner, Robin
    Hoffmann, Chris
    Khan, Asjad M.
    McKinley, Kathryn S.
    Bentzur, Rotem
    Diwan, Amer
    Feinberg, Daniel
    Frampton, Daniel
    Guyer, Samuel Z.
    Hirzel, Martin
    Hosking, Antony
    Jump, Maria
    Lee, Han
    Moss, J. Eliot B.
    Phansalkar, Aashish
    Stefanovic, Darko
    VanDrunen, Thomas
    von Dincklage, Daniel
    Wiedermann, Ben
    [J]. ACM SIGPLAN NOTICES, 2006, 41 (10) : 169 - 190
  • [6] Sound and Efficient Concurrency Bug Prediction
    Cai, Yan
    Yun, Hao
    Wang, Jinqiu
    Qiao, Lei
    Palsberg, Jens
    [J]. PROCEEDINGS OF THE 29TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '21), 2021, : 255 - 267
  • [7] Low-Overhead Deadlock Prediction
    Cai, Yan
    Meng, Ruijie
    Palsberg, Jens
    [J]. 2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 1298 - 1309
  • [8] Magiclock: Scalable Detection of Potential Deadlocks in Large-Scale Multithreaded Programs
    Cai, Yan
    Chan, W. K.
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2014, 40 (03) : 266 - 281
  • [9] Cai Y, 2012, PROC INT CONF SOFTW, P606, DOI 10.1109/ICSE.2012.6227156
  • [10] Strong computational lower bounds via parameterized complexity
    Chen, Jianer
    Huang, Xiuzhen
    Kanj, Iyad A.
    Xia, Ge
    [J]. JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 2006, 72 (08) : 1346 - 1367