Abstract
For a concurrent program, a prediction tool maps the history of a single run to a prediction of bugs in an exponential number of other runs. If all those bugs can occur, then the tool is sound. This is the case for some data race tools like RVPredict, but was, until now, not the case for deadlock tools. We present the first sound tool for predicting deadlocks in Java. Unlike previous work, we use request events and a novel form of executability constraints that enable sound and effective deadlock prediction. We model prediction as a general decision problem, which we show is decidable and can be instantiated to both deadlocks and data races. Our proof of decidability maps the decision problem to an equivalent constraint problem that we solve using an SMT-solver. Our experiments show that our tool finds real deadlocks effectively, including some missed by DeadlockFuzzer, which verifies each deadlock candidate by re-executing the input program. Our experiments also show that our tool can be used to predict more, real data races than RVPredict.
Supplemental Material
Available for Download
The proofs following the paper.
- Saddek Bensalem and Klaus Havelund. 2006. Dynamic Deadlock Analysis of Multi-threaded Programs. In Proceedings of the First Haifa International Conference on Hardware and Software Verification and Testing (HVC’05). Springer-Verlag, Berlin, Heidelberg, 208–223. Google Scholar
Digital Library
- Stephen M Blackburn, Robin Garner, Chris Hoffmann, Asjad M Khang, Kathryn S McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z Guyer, et al. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In ACM Sigplan Notices, Vol. 41. ACM, 169–190. Google Scholar
Digital Library
- Eric Bodden, Andreas Sewe, Jan Sinschek, Mira Mezini, and Hela Oueslati. 2011. Taming Reflection: Aiding Static Analysis in the Presence of Reflection and Custom Class Loaders. In Proceeding of the 33rd International Conference on Software Engineering (ICSE ’11). ACM, New York, NY, USA, 241–250. Google Scholar
Digital Library
- Eric Bruneton, Romain Lenglet, and Thierry Coupaye. 2002. ASM: a code manipulation tool to implement adaptable systems. Adaptable and extensible component systems 30, 19 (2002).Google Scholar
- Yan Cai and WK Chan. 2012. MagicFuzzer: scalable deadlock detection for large-scale applications. In Proceedings of the 34th International Conference on Software Engineering. IEEE Press, 606–616. Google Scholar
Digital Library
- Yan Cai and WK Chan. 2014. Magiclock: scalable detection of potential deadlocks in large-scale multithreaded programs. IEEE Transactions on Software Engineering 40, 3 (2014), 266–281. Google Scholar
Digital Library
- Yan Cai, Changjiang Jia, Shangru Wu, Ke Zhai, and Wing Kwong Chan. 2015. ASN: a dynamic barrier-based approach to confirmation of deadlocks from warnings for large-scale multithreaded programs. IEEE Transactions on Parallel and Distributed Systems 26, 1 (2015), 13–23.Google Scholar
Cross Ref
- Y. Cai and Q. Lu. 2016. Dynamic Testing for Deadlocks via Constraints. IEEE Transactions on Software Engineering 42, 9 (Sept 2016), 825–842.Google Scholar
Cross Ref
- Yan Cai, Shangru Wu, and WK Chan. 2014. ConLock: A constraint-based approach to dynamic checking on deadlocks in multithreaded programs. In Proceedings of the 36th International Conference on Software Engineering. ACM, 491–502. Google Scholar
Digital Library
- Feng Chen, Traian Florin Serbanuta, and Grigore Rosu. 2008. jPredictor: A Predictive Runtime Analysis Tool for Java. In Proceedings of the 30th International Conference on Software Engineering (ICSE ’08). ACM, New York, NY, USA, 221–230. Google Scholar
Digital Library
- Zhi Da Luo, Raja Das, and Yao Qi. 2011. Multicore SDK: A practical and efficient deadlock detector for real-world applications. In Software Testing, Verification and Validation (ICST), 2011 IEEE Fourth International Conference on. IEEE, 309–318. Google Scholar
Digital Library
- Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 337–340. Google Scholar
Digital Library
- Claudio DeMartini, Radu Iosif, and Riccardo Sisto. 1999. A deadlock detection tool for concurrent Java programs. Software: Practice and Experience 29, 7 (1999), 577–603. Google Scholar
Digital Library
- Hyunsook Do, Sebastian Elbaum, and Gregg Rothermel. 2005. Supporting controlled experimentation with testing techniques: An infrastructure and its potential impact. Empirical Software Engineering 10, 4 (2005), 405–435. Google Scholar
Digital Library
- Eelco Dolstra and Andres Löh. 2008. NixOS: A purely functional Linux distribution. In ACM Sigplan Notices, Vol. 43. ACM, 367–378. Google Scholar
Digital Library
- Matthew B Dwyer, John Hatcliff, Matthew Hoosier, Venkatesh Ranganath, Todd Wallentine, et al. 2006a. Evaluating the effectiveness of slicing for model reduction of concurrent object-oriented programs. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 73–89. Google Scholar
Digital Library
- Matthew B Dwyer, Suzette Person, and Sebastian Elbaum. 2006b. Controlling factors in evaluating path-sensitive error detection techniques. In Proceedings of the 14th ACM SIGSOFT international symposium on Foundations of software engineering. ACM, 92–104. Google Scholar
Digital Library
- Dawson Engler and Ken Ashcraft. 2003. RacerX: effective, static detection of race conditions and deadlocks. In ACM SIGOPS Operating Systems Review, Vol. 37. ACM, 237–252. Google Scholar
Digital Library
- Mahdi Eslamimehr and Jens Palsberg. 2014. Sherlock: scalable deadlock detection for concurrent programs. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 353–365. Google Scholar
Digital Library
- Jerry J Harrow. 2000. Runtime checking of multithreaded applications with visual threads. In International SPIN Workshop on Model Checking of Software. Springer, 331–342. Google Scholar
Digital Library
- Klaus Havelund. 2000. Using runtime analysis to guide model checking of Java programs. In International SPIN Workshop on Model Checking of Software. Springer, 245–264. Google Scholar
Digital Library
- Klaus Havelund and Thomas Pressburger. 2000. Model checking java programs using java pathfinder. International Journal on Software Tools for Technology Transfer (STTT) 2, 4 (2000), 366–381.Google Scholar
Cross Ref
- Gerard J. Holzmann. 1990. Design and Validation of Protocols. Tutorial Computer Networks and ISDN Systems 25 (1990), 981–1017. Google Scholar
Digital Library
- Jeff Huang. 2015. Stateless model checking concurrent programs with maximal causality reduction. In ACM SIGPLAN Notices, Vol. 50. ACM, 165–174. Google Scholar
Digital Library
- Jeff Huang, Qingzhou Luo, and Grigore Rosu. 2015. GPredict: Generic predictive concurrency analysis. In Proceedings of the 37th International Conference on Software Engineering-Volume 1. IEEE Press, 847–857. Google Scholar
Digital Library
- Jeff Huang, Patrick O’Neil Meredith, and Grigore Rosu. 2014. Maximal Sound Predictive Race Detection with Control Flow Abstraction. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA, 337–348. Google Scholar
Digital Library
- Pallavi Joshi, Chang-Seo Park, Koushik Sen, and Mayur Naik. 2009. A randomized dynamic program analysis technique for detecting real deadlocks. In ACM Sigplan Notices, Vol. 44. ACM, 110–120. Google Scholar
Digital Library
- Dileep Kini, Umang Mathur, and Mahesh Viswanathan. 2017. Dynamic race prediction in linear time. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 157–170. Google Scholar
Digital Library
- Leslie Lamport. 1978. Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21, 7 (1978), 558–565. Google Scholar
Digital Library
- Ziyi Lin, Darko Marinov, Hao Zhong, Yuting Chen, and Jianjun Zhao. 2015. Jacontebe: A benchmark suite of real-world java concurrency bugs (T). In Automated Software Engineering (ASE), 2015 30th IEEE/ACM International Conference on. IEEE, 178–189.Google Scholar
Digital Library
- Mayur Naik, Chang-Seo Park, Koushik Sen, and David Gay. 2009. Effective static deadlock detection. In Software Engineering, 2009. ICSE 2009. IEEE 31st International Conference on. IEEE, 386–396. Google Scholar
Digital Library
- Mahmoud Said, Chao Wang, Zijiang Yang, Karem Sakallah, and Karem Sakallahg. 2011. Generating data race witnesses by an SMT-based analysis. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 6617 LNCS (2011), 313–327. Google Scholar
Digital Library
- Traian Florin Serbanuta, Feng Chen, and Grigore Rosu. 2008. Maximal Causal Models for Multithreaded Systems. Technical Report UIUCDCS–R–2008–3017. University of Illinois at Urbana-Champaign.Google Scholar
- Traian Florin Şerbănuţă, Feng Chen, and Grigore Roşu. 2012. Maximal causal models for sequentially consistent systems. In International Conference on Runtime Verification. Springer, 136–150.Google Scholar
- Traian Florin Serbanuta, Feng Chen, and Grigore Rosu. 2012. Maximal causal models for sequentially consistent systems. In International Conference on Runtime Verification. Springer, 136–150.Google Scholar
- Yannis Smaragdakis, Jacob Evans, Caitlin Sadowski, Jaeheon Yi, and Cormac Flanagan. 2012. Sound predictive race detection in polynomial time. In ACM Sigplan Notices, Vol. 47. ACM, 387–400. Google Scholar
Digital Library
- Francesco Sorrentino. 2015. PickLock: A deadlock prediction approach under nested locking. In Model Checking Software. Springer, 179–199. Google Scholar
Digital Library
- Willem Visser, Klaus Havelund, Guillaume Brat, SeungJoon Park, and Flavio Lerda. 2003. Model checking programs. Automated Software Engineering 10, 2 (2003), 203–232. Google Scholar
Digital Library
- Chao Wang, Sudipta Kundu, Malay Ganai, and Aarti Gupta. 2009. Symbolic Predictive Analysis for Concurrent Programs. In FM 2009: Formal Methods, Ana Cavalcanti and Dennis R. Dams (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 256–272. Google Scholar
Digital Library
Index Terms
Sound deadlock prediction
Recommendations
Sound and efficient concurrency bug prediction
ESEC/FSE 2021: Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software EngineeringConcurrency bugs are extremely difficult to detect. Recently, several dynamic techniques achieve sound analysis. M2 is even complete for two threads. It is designed to decide whether two events can occur consecutively. However, real-world concurrency ...
Sound Dynamic Deadlock Prediction in Linear Time
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 ...
Scrider: Using Single Critical Sections to Avoid Deadlocks
IMCCC '14: Proceedings of the 2014 Fourth International Conference on Instrumentation and Measurement, Computer, Communication and ControlWe propose a method, called Scrider, to avoid dead-locks before they manifest themselves. When running it togeth-er with a multithreaded program, Scrider interferes in thread scheduling to ensure that at any time there is only one thread in the critical ...






Comments