Radius aware probabilistic testing of deadlocks with guarantees

Concurrency bugs only occur under certain interleaving. Existing randomized techniques are usually ineffective. PCT innovatively generates scheduling, before executing a program, based on priorities and priority change points. Hence, it provides a probabilistic guarantee to trigger concurrency bugs. PCT randomly selects priority change points among all events, which might be effective for non-deadlock concurrency bugs. However, deadlocks usually involve two or more threads and locks, and require more ordering constraints to be triggered. We interestingly observe that, every two events of a deadlock usually occur within a short range. We generally formulate this range as the bug Radius, to denote the max distance of every two events of a concurrency bug. Based on the bug radius, we propose RPro (Radius aware Probabilistic testing) for triggering deadlocks. Unlike PCT, RPro selects priority change points within the radius of the targeted deadlocks but not among all events. Hence, it guarantees larger probabilities to trigger deadlocks. We have implemented RPro and PCT and evaluated them on a set of real-world benchmarks containing 10 unique deadlocks. The experimental results show that RPro triggered all deadlocks with higher probabilities (i.e., >7.7x times larger on average) than that by PCT. We also evaluated RPro with radius varying from 1 to 150 (or 300). The result shows that the radius of a deadlock is much smaller (i.e., from 2 to 114 in our experiment) than the number of all events. This further confirms our observation and makes RPro meaningful in practice.

[1]  Vineet Kahlon,et al.  Reasoning About Threads Communicating via Locks , 2005, CAV.

[2]  W. K. Chan,et al.  ConLock: a constraint-based approach to dynamic checking on deadlocks in multithreaded programs , 2014, ICSE.

[3]  Shmuel Ur,et al.  Deadlocks: From Exhibiting to Healing , 2008, RV.

[4]  Charles Zhang,et al.  Axis: Automatically fixing atomicity violations through solving control constraints , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[5]  Stephen N. Freund,et al.  FastTrack: efficient and precise dynamic race detection , 2009, PLDI '09.

[6]  Sandeep S. Kulkarni,et al.  Automatic repair for multi-threaded programs with Deadlock/Livelock using maximum satisfiability , 2014, ISSTA 2014.

[7]  Thomas Ball,et al.  Finding and Reproducing Heisenbugs in Concurrent Programs , 2008, OSDI.

[8]  Wei Zhang,et al.  Automated Concurrency-Bug Fixing , 2012, OSDI.

[9]  Klaus Havelund,et al.  Confirmation of deadlock potentials detected by runtime analysis , 2006, PADTAD '06.

[10]  Yosi Ben-Asher,et al.  Producing scheduling that causes concurrent programs to fail , 2006, PADTAD '06.

[11]  Ding Yuan,et al.  How do fixes become bugs? , 2011, ESEC/FSE '11.

[12]  Shan Lu,et al.  ConAir: featherweight concurrency bug recovery via single-threaded idempotent execution , 2013, ASPLOS '13.

[13]  Wing Kwong Chan,et al.  ASN: A Dynamic Barrier-Based Approach to Confirmation of Deadlocks from Warnings for Large-Scale Multithreaded Programs , 2015, IEEE Transactions on Parallel and Distributed Systems.

[14]  Satish Narayanasamy,et al.  Maple: a coverage-driven testing tool for multithreaded programs , 2012, OOPSLA '12.

[15]  Vivek Sarkar,et al.  Test-driven repair of data races in structured parallel programs , 2014, PLDI.

[16]  Ugo Buy,et al.  Testing Database-Centric Applications for Causes of Database Deadlocks , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

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

[18]  Vivek K. Shanbhag Deadlock-Detection in Java-Library Using Static-Analysis , 2008, 2008 15th Asia-Pacific Software Engineering Conference.

[19]  Koushik Sen,et al.  CUTE and jCUTE: Concolic Unit Testing and Explicit Path Model-Checking Tools , 2006, CAV.

[20]  Francesco Sorrentino,et al.  PENELOPE: weaving threads to expose atomicity violations , 2010, FSE '10.

[21]  George Candea,et al.  Execution synthesis: a technique for automated software debugging , 2010, EuroSys '10.

[22]  Sriram Sankaranarayanan,et al.  Symbolic Deadlock Analysis in Concurrent Libraries and Their Clients , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[23]  Claire Le Goues,et al.  Current challenges in automatic software repair , 2013, Software Quality Journal.

[24]  Yuanyuan Zhou,et al.  CTrigger: exposing atomicity violation bugs from their hiding places , 2009, ASPLOS.

[25]  Charles Zhang,et al.  Grail: context-aware fixing of concurrency bugs , 2014, SIGSOFT FSE.

[26]  Bensalem Saddek,et al.  SCALABLE DYNAMIC DEADLOCK ANALYSIS OF MULTI-THREADED PROGRAMS , 2005 .

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

[28]  Yuanyuan Zhou,et al.  Learning from mistakes: a comprehensive study on real world concurrency bug characteristics , 2008, ASPLOS.

[29]  Yan Cai,et al.  Fixing Deadlocks via Lock Pre-Acquisitions , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[30]  Madan Musuvathi,et al.  Iterative context bounding for systematic testing of multithreaded programs , 2007, PLDI '07.

[31]  Bertrand Meyer,et al.  Automatic Program Repair by Fixing Contracts , 2014, FASE.

[32]  Chao Wang,et al.  ConcBugAssist: constraint solving for diagnosis and repair of concurrency bugs , 2015, ISSTA.

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

[34]  Thomas R. Gross,et al.  FULLY AUTOMATIC AND PRECISE DETECTION OF THREAD SAFETY VIOLATIONS PLDI 2012 , 2013 .

[35]  Claire Le Goues,et al.  GenProg: A Generic Method for Automatic Software Repair , 2012, IEEE Transactions on Software Engineering.

[36]  Scott A. Mahlke,et al.  Gadara: Dynamic Deadlock Avoidance for Multithreaded Programs , 2008, OSDI.

[37]  W. K. Chan,et al.  MagicFuzzer: Scalable deadlock detection for large-scale applications , 2012, 2012 34th International Conference on Software Engineering (ICSE).

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

[39]  Horatiu Jula,et al.  Deadlock Immunity: Enabling Systems to Defend Against Deadlocks , 2008, OSDI.

[40]  Sebastian Burckhardt,et al.  Multicore acceleration of priority-based schedulers for concurrency bug detection , 2012, PLDI.

[41]  Konstantinos Sagonas,et al.  Dynamic deadlock avoidance in systems code using statically inferred effects , 2011, PLOS '11.

[42]  Sangmin Park,et al.  Debugging non-deadlock concurrency bugs , 2013, ISSTA.

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

[44]  Raja Das,et al.  MulticoreSDK: a practical and efficient data race detector for real-world applications , 2009, PADTAD '09.

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

[46]  Claire Le Goues,et al.  Automatic program repair with evolutionary computation , 2010, Commun. ACM.

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

[48]  Pravesh Kothari,et al.  A randomized scheduler with probabilistic guarantees of finding bugs , 2010, ASPLOS XV.

[49]  Murali Krishna Ramanathan,et al.  Multithreaded test synthesis for deadlock detection , 2014, OOPSLA.

[50]  Claire Le Goues,et al.  A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[51]  Shan Lu,et al.  Automated atomicity-violation fixing , 2011, PLDI '11.

[52]  Jian Zhou,et al.  Where should the bugs be fixed? More accurate information retrieval-based bug localization based on bug reports , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[53]  Harish Patil,et al.  Pin: building customized program analysis tools with dynamic instrumentation , 2005, PLDI '05.

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

[55]  Vivek Sarkar,et al.  Scalable and precise dynamic datarace detection for structured parallelism , 2012, PLDI.

[56]  Murali Krishna Ramanathan,et al.  Trace driven dynamic deadlock detection and reproduction , 2014, PPoPP.

[57]  Hari K. Pyla,et al.  Avoiding deadlock avoidance , 2010, 2010 19th International Conference on Parallel Architectures and Compilation Techniques (PACT).

[58]  Ugo Buy,et al.  Preventing database deadlocks in applications , 2013, ESEC/FSE 2013.

[59]  References , 1971 .

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

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