Efficient predictive analysis for detecting nondeterminism in multi-threaded programs

Determinism is often a desired property in multithreaded programs. A multi-threaded program is said to be deterministic if for a given input, different thread interleavings result in the same system state in the execution of the program. This, in turn, requires that different interleavings preserve the values read by each read operation. A related, but less strict condition is for the program to be race-free. A deterministic program is race-free but the converse may not be true. There is much work done in the static analysis of programs to detect races and nondeterminism. However, this can be expensive and may not complete for large programs in reasonable time. In contrast to static analysis, predictive analysis techniques take a given program trace and explore other possible interleavings that may violate a given property - in this case the property of interest is determinism. Predictive analysis can be sound, but is not complete as it is limited to a specific set of program runs. Nonetheless, it is of interest as it offers greater scalability than static analysis. This work presents a predictive analysis method for detecting nondeterminism in multi-threaded programs. Potential cases of nondeterminism are checked by constructing a causality graph from the thread events and confirming that it is acyclic. On average, the number of graphs analyzed per benchamrk is one per potential case of nondeterminism, thereby ensuring that it is efficient. We demonstrate its application on some benchmark Java and C/C++ programs.

[1]  Frank Tip,et al.  Associating synchronization constraints with data in an object-oriented language , 2006, POPL '06.

[2]  Eitan Farchi,et al.  Concurrent bug patterns and how to test them , 2003, Proceedings International Parallel and Distributed Processing Symposium.

[3]  Charles E. McDowell,et al.  Debugging concurrent programs , 1989, ACM Comput. Surv..

[4]  Sharad Malik,et al.  Predictive analysis for detecting serializability violations through Trace Segmentation , 2011, Ninth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMPCODE2011).

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

[6]  Sarita V. Adve,et al.  Parallel programming must be deterministic by default , 2009 .

[7]  Thomas R. Gross,et al.  Static Detection of Atomicity Violations in Object-Oriented Programs , 2004, J. Object Technol..

[8]  Barton P. Miller,et al.  What are race conditions?: Some issues and formalizations , 1992, LOPL.

[9]  Stephen N. Freund,et al.  SingleTrack: A Dynamic Determinism Checker for Multithreaded Programs , 2009, ESOP.

[10]  Sriram Sankaranarayanan,et al.  Semantic Reduction of Thread Interleavings in Concurrent Programs , 2009, TACAS.

[11]  ChoiJong-Deok,et al.  Efficient and precise datarace detection for multithreaded object-oriented programs , 2002 .

[12]  Sebastian Burckhardt,et al.  Deconstructing concurrency heisenbugs , 2009, 2009 31st International Conference on Software Engineering - Companion Volume.

[13]  Grigore Rosu,et al.  Parametric and Sliced Causality , 2007, CAV.

[14]  Serdar Tasiran,et al.  Goldilocks: a race-aware Java runtime , 2010, Commun. ACM.

[15]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[16]  Yannis Smaragdakis,et al.  Sound predictive race detection in polynomial time , 2012, POPL '12.

[17]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.

[18]  LamportLeslie Time, clocks, and the ordering of events in a distributed system , 1978 .

[19]  Marek Olszewski,et al.  Kendo: efficient deterministic multithreading in software , 2009, ASPLOS.

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

[21]  Vivek Sarkar,et al.  Automatic Verification of Determinism for Structured Parallel Programs , 2010, SAS.

[22]  Chao Wang,et al.  Universal Causality Graphs: A Precise Happens-Before Model for Detecting Bugs in Concurrent Programs , 2010, CAV.

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

[24]  Dan Grossman,et al.  CoreDet: a compiler and runtime system for deterministic multithreaded execution , 2010, ASPLOS XV.

[25]  Xiangyu Zhang,et al.  Quasi-static scheduling for safe futures , 2008, PPoPP.

[26]  Jong-Deok Choi,et al.  Efficient and precise datarace detection for multithreaded object-oriented programs , 2002, PLDI '02.

[27]  Christos H. Papadimitriou,et al.  The serializability of concurrent database updates , 1979, JACM.

[28]  Emery D. Berger,et al.  Dthreads: efficient deterministic multithreading , 2011, SOSP.

[29]  Nicholas Sterling,et al.  WARLOCK - A Static Data Race Analysis Tool , 1993, USENIX Winter.

[30]  Grigore Rosu,et al.  jPredictor: a predictive runtime analysis tool for java , 2008, ICSE '08.

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

[32]  Sen Hu,et al.  Efficient system-enforced deterministic parallelism , 2010, OSDI.

[33]  Junfeng Yang,et al.  Efficient deterministic multithreading through schedule relaxation , 2011, SOSP.

[34]  Luis Ceze,et al.  Deterministic Process Groups in dOS , 2010, OSDI.