A lightweight deadlock analysis for programs with threads and reentrant locks

Abstract Deadlock analysis of multi-threaded programs with reentrant locks is complex because these programs may have infinitely many states. We define a simple calculus featuring recursion, threads and synchronizations that guarantee exclusive access to objects. We detect deadlocks by associating an abstract model to programs – the extended lam model – and we define an algorithm for verifying that a problematic object dependency (e.g. a circularity) between threads will not be manifested. The analysis is lightweight because the deadlock detection problem is fully reduced to the corresponding one in lams (without using other models). In fact, the technique is intended to be an effective tool for the deadlock analysis of programming languages by defining ad-hoc extraction processes. We demonstrate this effectivity by applying our analysis to a core calculus featuring shared objects, threads and Java -like synchronization primitives. We also discuss a prototype verifier, called JaDA , that covers several features of Java and deliver initial assessments of the tool.

[1]  Cosimo Laneve,et al.  Deadlock analysis of unbounded process networks , 2014, Inf. Comput..

[2]  Naoki Kobayashi,et al.  A New Type System for Deadlock-Free Processes , 2006, CONCUR.

[3]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[4]  Klaus Havelund,et al.  Dynamic Deadlock Analysis of Multi-threaded Programs , 2005, Haifa Verification Conference.

[5]  Martín Abadi,et al.  Types for safe locking: Static race detection for Java , 2006, TOPL.

[6]  Cosimo Laneve,et al.  Deadlock detection of Java Bytecode , 2017, LOPSTR.

[7]  Robin Milner,et al.  A Calculus of Communicating Systems , 1980, Lecture Notes in Computer Science.

[8]  Neil D. Jones,et al.  Complexity of Some Problems in Petri Nets , 1977, Theor. Comput. Sci..

[9]  Wolfgang Reisig Petri Nets: An Introduction , 1985, EATCS Monographs on Theoretical Computer Science.

[10]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[11]  Cosimo Laneve,et al.  Deadlock Detection in Linear Recursive Programs , 2014, SFM.

[12]  Cosimo Laneve,et al.  A framework for deadlock detection in core ABS , 2015, Software & Systems Modeling.

[13]  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 .

[14]  Cosimo Laneve,et al.  A Lightweight Deadlock Analysis for Programs with Threads and Reentrant Locks , 2018, FM.

[15]  Elvira Albert,et al.  May-Happen-in-Parallel Based Deadlock Analysis for Concurrent Objects , 2013, FMOODS/FORTE.

[16]  Cosimo Laneve,et al.  Deadlock Analysis of Unbounded Process Networks , 2014, CONCUR.

[17]  Abel Garcia Celestrin Static Analysis of Concurrent Programs Based on Behavioral Type Systems , 2017 .

[18]  Francisco Martins,et al.  Type Inference for Deadlock Detection in a Multithreaded Polymorphic Typed Assembly Language , 2009, PLACES.

[19]  Robert Atkey,et al.  ThreadSafe: Static Analysis for Java Concurrency , 2015, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[20]  Martin Odersky,et al.  An Overview of the Scala Programming Language , 2004 .

[21]  Reiner Hähnle,et al.  ABS: A Core Language for Abstract Behavioral Specification , 2010, FMCO.

[22]  Kohei Suenaga Type-Based Deadlock-Freedom Verification for Non-Block-Structured Lock Primitives and Mutable References , 2008, APLAS.

[23]  David Gay,et al.  Effective static deadlock detection , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[24]  Brian A. Davey,et al.  An Introduction to Lattices and Order , 1989 .

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

[26]  Jens Palsberg,et al.  Sherlock: scalable deadlock detection for concurrent programs , 2014, SIGSOFT FSE.