Static Deadlock Detection for Java Libraries

Library writers wish to provide a guarantee not only that each procedure in the library performs correctly in isolation, but also that the procedures perform correctly when run in conjunction. To this end, we propose a method for static detection of deadlock in Java libraries. Our goal is to determine whether client code exists that may deadlock a library, and, if so, to enable the library writer to discover the calling patterns that can lead to deadlock. Our flow-sensitive, context-sensitive analysis determines possible deadlock configurations using a lock-order graph. This graph represents the order in which locks are acquired by the library. Cycles in the graph indicate deadlock possibilities, and our tool reports all such possibilities. We implemented our analysis and evaluated it on 18 libraries comprising 1245 kLOC. We verified 13 libraries to be free from deadlock, and found 14 distinct deadlocks in 3 libraries.

[1]  Mukesh Singhal,et al.  Deadlock detection in distributed systems , 1989, Computer.

[2]  J. Stankovic,et al.  Survey of Deadlock Detection in Distributed Concurrent Programming Environments and Its Application to Real-Time Systems , 1990 .

[3]  Barbara G. Ryder,et al.  A model of Ada programs for static deadlock detection in polynomial times , 1991, PADD '91.

[4]  James C. Corbett,et al.  Evaluating Deadlock Detection Methods for Concurrent Software , 1996, IEEE Trans. Software Eng..

[5]  E. J. Friedman-hill,et al.  Jess, the Java expert system shell , 1997 .

[6]  Claudio Demartini,et al.  A deadlock detection tool for concurrent Java programs , 1999, Softw. Pract. Exp..

[7]  Klaus Havelund,et al.  Model checking JAVA programs using JAVA PathFinder , 2000, International Journal on Software Tools for Technology Transfer.

[8]  Klaus Havelund,et al.  Using Runtime Analysis to Guide Model Checking of Java Programs , 2013, SPIN.

[9]  Armin Biere,et al.  Applying static analysis to large-scale, multi-threaded Java programs , 2001, Proceedings 2001 Australian Software Engineering Conference.

[10]  Grigore Rosu,et al.  Monitoring Java Programs with Java PathExplorer , 2001, RV@CAV.

[11]  Martin C. Rinard,et al.  ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), November 2002 Ownership Types for Safe Programming: Preventing Data Races and Deadlocks , 2022 .

[12]  Alex Groce,et al.  Modular verification of software components in C , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[13]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[14]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[15]  Zeng Fancong Deadlock resolution via exceptions for dependable Java applications , 2003, 2003 International Conference on Dependable Systems and Networks, 2003. Proceedings..

[16]  Joël Ouaknine,et al.  Automated, compositional and iterative deadlock detection , 2004, Proceedings. Second ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2004. MEMOCODE '04..

[17]  Christoph von Praun,et al.  Detecting synchronization defects in multi-threaded object-oriented programs , 2004 .

[18]  Mark N. Wegman,et al.  Analysis of pointers and structures , 1990, SIGP.

[19]  Peter T. Breuer,et al.  Static Deadlock Detection in the Linux Kernel , 2004, Ada-Europe.

[20]  Amy L. Williams Static Detection of Deadlock for Java Libraries , 2005 .

[21]  Tong Li,et al.  Pulse: A Dynamic Deadlock Detection Mechanism Using Speculative Execution , 2005, USENIX Annual Technical Conference, General Track.