Sound Static Deadlock Analysis for C/Pthreads (Extended Version)

We present a static deadlock analysis approach for C/pthreads. The design of our method has been guided by the requirement to analyse real-world code. Our approach is sound (i.e., misses no deadlocks) for programs that have defined behaviour according to the C standard, and precise enough to prove deadlock-freedom for a large number of programs. The method consists of a pipeline of several analyses that build on a new context- and thread-sensitive abstract interpretation framework. We further present a lightweight dependency analysis to identify statements relevant to deadlock analysis and thus speed up the overall analysis. In our experimental evaluation, we succeeded to prove deadlock-freedom for 262 programs from the Debian GNU/Linux distribution with in total 2.6 MLOC in less than 11 hours.

[1]  Sriram Sankaranarayanan,et al.  Fast and Accurate Static Data-Race Detection for Concurrent Programs , 2007, CAV.

[2]  Michael D. Ernst,et al.  Static Deadlock Detection for Java Libraries , 2005, ECOOP.

[3]  W. K. Chan,et al.  Magiclock: Scalable Detection of Potential Deadlocks in Large-Scale Multithreaded Programs , 2014, IEEE Transactions on Software Engineering.

[4]  Koushik Sen,et al.  A randomized dynamic program analysis technique for detecting real deadlocks , 2009, PLDI '09.

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

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

[7]  Jens Palsberg,et al.  Efficient May Happen in Parallel Analysis for Async-Finish Parallelism , 2012, SAS.

[8]  Barbara G. Ryder,et al.  Non-concurrency analysis , 1993, PPOPP '93.

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

[10]  Daniel Kroening,et al.  Precise Predictive Analysis for Discovering Communication Deadlocks in MPI Programs , 2014, FM.

[11]  George S. Avrunin,et al.  A conservative data flow algorithm for detecting all pairs of statements that may happen in parallel , 1998, SIGSOFT '98/FSE-6.

[12]  Feng Qin,et al.  SyncChecker: Detecting Synchronization Errors between MPI Applications and Libraries , 2012, 2012 IEEE 26th International Parallel and Distributed Processing Symposium.

[13]  Mangala Gowri Nanda,et al.  Slicing concurrent programs , 2000, ISSTA '00.

[14]  Jens Krinke,et al.  Static slicing of threaded programs , 1998, PASTE '98.

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

[16]  Francesco Sorrentino,et al.  PickLock: A Deadlock Prediction Approach under Nested Locking , 2015, SPIN.

[17]  Daniel Kroening,et al.  Automating Software Analysis at Large Scale , 2014, MEMICS.

[18]  Elvira Albert,et al.  Analysis of May-Happen-in-Parallel in Concurrent Objects , 2012, FMOODS/FORTE.

[19]  Robert Feldt,et al.  Validity Threats in Empirical Software Engineering Research - An Initial Survey , 2010, SEKE.

[20]  Joseph Sifakis,et al.  D-Finder: A Tool for Compositional Deadlock Detection and Verification , 2009, CAV.

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

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

[23]  Jens Krinke,et al.  Context-sensitive slicing of concurrent programs , 2003, ESEC/FSE-11.

[24]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[25]  Raja Das,et al.  Multicore SDK: A Practical and Efficient Deadlock Detector for Real-World Applications , 2011, 2011 Fourth IEEE International Conference on Software Testing, Verification and Validation.

[26]  Eitan Farchi,et al.  Detection of deadlock potentials in multithreaded programs , 2010, IBM J. Res. Dev..

[27]  Rahul Agarwal,et al.  Run-time detection of potential deadlocks for programs with locks, semaphores, and condition variables , 2006, PADTAD '06.

[28]  Thomas A. Henzinger,et al.  Lazy abstraction , 2002, POPL '02.

[29]  David Gay,et al.  An effective dynamic analysis for detecting generalized deadlocks , 2010, FSE '10.

[30]  Axel Legay,et al.  Efficient deadlock detection for concurrent systems , 2011, Ninth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMPCODE2011).

[31]  Jong-Deok Choi,et al.  Flow-Insensitive Interprocedural Alias Analysis in the Presence of Pointers , 1994, LCPC.

[32]  Martin C. Rinard,et al.  Analysis of Multithreaded Programs , 2001, SAS.

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

[34]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.