Skip to main content
Log in

Symbolic modular deadlock analysis

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Methods in object-oriented concurrent libraries often encapsulate internal synchronization details. As a result of information hiding, clients calling the library methods may cause thread safety violations by invoking methods in an unsafe manner. This is frequently a cause of deadlocks. Given a concurrent library, we present a technique for inferring interface contracts that specify permissible concurrent method calls and patterns of aliasing among method arguments. In this work, we focus on deriving contracts that guarantee deadlock-free execution for the methods in the library. The contracts also help client developers by documenting required assumptions about the library methods. Alternatively, the contracts can be statically enforced in the client code to detect potential deadlocks in the client. Our technique combines static analysis with a symbolic encoding scheme for tracking lock dependencies, allowing us to synthesize contracts using a SMT solver. Additionally, we investigate extensions of our technique to reason about deadlocks in libraries that employ signaling primitives such as wait-notify for cooperative synchronization. Our prototype tool analyzes over a million lines of code for some widely-used Java libraries within an hour, thus demonstrating its scalability and efficiency. Furthermore, the contracts inferred by our approach have been able to pinpoint real deadlocks in clients, i.e. deadlocks that have been a part of bug-reports filed by users and developers of client code.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Agarwal, R., Stoller, S.D.: Run-time detection of potential deadlocks for programs with locks, semaphores, and condition variables. In: Proc. of Workshop on Parallel and Distributed Systems: Testing and Debugging, pp. 51–60 (2006)

    Chapter  Google Scholar 

  • Agarwal, R., Wang, L., Stoller, S.: Detecting Potential Deadlocks with Static Analysis and Run-Time Monitoring. Hardware and Software, Verification and Testing, pp. 191–207 (2006)

    Google Scholar 

  • Open Source Mail Archive (2004) Message #150. URL http://osdir.com/ml/java.hsqldb.user/2004-03/msg00150.html

  • Open Source Mail Archive (2008) Bug 159. URL http://osdir.com/ml/java.openjdk.distro-packaging.devel/2008-06/msg00061.html

  • Artho, C., Biere, A.: Applying static analysis to large-scale, multi-threaded Java programs. In: Proc. of the 13th Australian Conference on Software Engineering, p. 68 (2001)

    Google Scholar 

  • Bensalem, S., Havelund, K.: Dynamic deadlock analysis of multi-threaded programs. In: Proc. of the Haifa Verification Conference, pp. 208–223 (2005)

    Google Scholar 

  • Clarke, E.M., Emerson, E.A.: Design and synthesis of synchronization skeletons using branching-time temporal logic. In: Logics of Programs, pp. 52–71 (1981)

    Google Scholar 

  • Corbett, J.C.: Evaluating deadlock detection methods for concurrent software. IEEE Trans. Softw. Eng. 22(3), 161–180 (1996)

    Article  Google Scholar 

  • Sun Developer Network Bug Database (2007). URL http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=xxxx, bug-id provided at citation

  • Deshmukh, J.V., Emerson, E.A., Sankaranarayanan, S.: Symbolic deadlock analysis in concurrent libraries and their clients. In: Proc. of the 24th IEEE /ACM International Conference on Automated Software Engineering, pp. 480–491 (2009)

    Google Scholar 

  • Dutertre, B., de Moura, L.: A fast linear-arithmetic solver for DPLL(T). In: Proc. of Computer Aided Verification, pp. 81–94 (2006)

    Chapter  Google Scholar 

  • Engler, D., Ashcraft, K.: Racerx: effective, static detection of race conditions and deadlocks. ACM SIGOPS Oper. Syst. Rev. 37(5), 237–252 (2003)

    Article  Google Scholar 

  • Flanagan, C., Freund, S.N., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In: Proc. of PLDI, pp. 293–303 (2008)

    Google Scholar 

  • Havelund, K.: Using runtime analysis to guide model checking of Java programs. In: Proc. of SPIN Workshop on Model Checking of Software, pp. 245–264 (2000)

    Chapter  Google Scholar 

  • Havelund, K., Pressburger, T.: Model checking JAVA programs using Java pathfinder. Int. J. Softw. Tools Technol. Transf. 2(4), 366–381 (2000)

    Article  MATH  Google Scholar 

  • Holzmann, G.J.: The SPIN Model Checker. Addison-Wesley, Reading (2003)

    Google Scholar 

  • Jajuk Advanced Jukebox (2008). Bug Ticket #850. URL http://trac.jajuk.info/ticket/850

  • Lahiri, S.K., Musuvathi, M.: An efficient decision procedure for UTVPI constraints. In: Proc. of Frontiers of Combining Systems, 5th International Workshop, pp. 168–183 (2005)

    Google Scholar 

  • Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978). URL http://portal.acm.org.ezproxy.lib.utexas.edu/citation.cfm?id=359563

    Article  MATH  Google Scholar 

  • Li, L., Verbrugge, C.: A practical MHP information analysis for concurrent Java programs. In: Proc. of the 17th International Workshop on Languages and Compilers for Parallel Computing, pp. 194–208 (2004)

    Google Scholar 

  • Lister, A.: The problem of nested monitor calls. SIGOPS Oper. Syst. Rev. 11(3), 5–7 (1977)

    Article  Google Scholar 

  • de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Proc. of Tools and Algorithms for the Construction and Analysis of Systems, pp. 337–340 (2008)

    Chapter  Google Scholar 

  • Naik, M., Aiken, A., Whaley, J.: Effective static race detection for Java. In: Proc. of the 2006 ACM SIGPLAN Conf. on Programming Language Design and Implementation, pp. 308–319. ACM, New York (2006)

    Chapter  Google Scholar 

  • Naik, M., Park, C.S., Sen, K., Gay, D.: Effective static deadlock detection. In: Proc. of the 31st International Conference on Software Engineering, pp. 386–396 (2009)

    Google Scholar 

  • Otto, F., Moschny, T.: Finding synchronization defects in Java programs: extended static analyses and code patterns. In: Proc. of 1st International Workshop on Multicore Software Engineering, pp. 41–46 (2008)

    Chapter  Google Scholar 

  • von Praun, C.: Detecting synchronization defects in multi-threaded object-oriented programs. PhD thesis, ETH Zurich (2004)

  • Ramalingam, G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22(2), 416–430 (2000)

    Article  Google Scholar 

  • Shanbhag, V.K.: Deadlock-detection in Java-library using static-analysis. In: Proc. of the 15th Asia-Pacific Software Engineering Conference, pp. 361–368 (2008)

    Chapter  Google Scholar 

  • Vallée-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., Co, P.: Soot—a Java Optimization Framework. In: Proc. of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research, pp. 125–135 (1999)

    Google Scholar 

  • Williams, A., Thies, W., Ernst, M.D.: Static deadlock detection for Java libraries. In:Proc. of the European Conference on Object-Oriented Programming, pp. 602–629 (2005)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jyotirmoy V. Deshmukh.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Deshmukh, J.V., Emerson, E.A. & Sankaranarayanan, S. Symbolic modular deadlock analysis. Autom Softw Eng 18, 325–362 (2011). https://doi.org/10.1007/s10515-011-0085-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10515-011-0085-0

Keywords

Navigation