DETERMIN: inferring likely deterministic specifications of multithreaded programs

The trend towards multicore processors and graphic processing units is increasing the need for software that can take advantage of parallelism. Writing correct parallel programs using threads, however, has proven to be quite challenging due to nondeterminism. The threads of a parallel application may be interleaved nondeterministically during execution, which can lead to nondeterministic results---some interleavings may produce the correct result while others may not. We have previously proposed an assertion framework for specifying that regions of a parallel program behave deterministically despite nondeterministic thread interleaving. The framework allows programmers to write assertions involving pairs of program states arising from different parallel schedules. We propose an algorithm to dynamically infer likely deterministic specifications for parallel programs given a set of inputs and schedules. We have implemented our specification inference algorithm for Java and have applied it to a number of previously examined Java benchmarks. We were able to automatically infer specifications largely equivalent to or stronger than our manual assertions from our previous work. We believe that the inference of deterministic specifications can aid in understanding and documenting the deterministic behavior of parallel programs. Moreover, an unexpected deterministic specification can indicate to a programmer the presence of erroneous or unintended behavior.

[1]  Monica S. Lam,et al.  Automatic extraction of object-oriented component interfaces , 2002, ISSTA '02.

[2]  Cormac Flanagan,et al.  Types for atomicity , 2003, TLDI '03.

[3]  Francesco Logozzo,et al.  Automatic Inference of Class Invariants , 2004, VMCAI.

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

[5]  William Thies,et al.  StreamIt: A Language for Streaming Applications , 2002, CC.

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

[7]  Greg Nelson,et al.  Extended static checking for Java , 2002, PLDI '02.

[8]  William G. Griswold,et al.  Quickly detecting relevant program invariants , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[9]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..

[10]  Brandon Lucia,et al.  DMP: Deterministic Shared-Memory Multiprocessing , 2010, IEEE Micro.

[11]  Pavol Cerný,et al.  Synthesis of interface specifications for Java classes , 2005, POPL '05.

[12]  Edward A. Lee The problem with threads , 2006, Computer.

[13]  Rita Loogen,et al.  Comparing Parallel Functional Languages: Programming and Performance , 2003, High. Order Symb. Comput..

[14]  Koushik Sen,et al.  Asserting and checking determinism for multithreaded programs , 2009, ESEC/FSE '09.

[15]  K. Rustan M. Leino,et al.  Houdini, an Annotation Assistant for ESC/Java , 2001, FME.

[16]  Mana Taghdiri,et al.  Inferring specifications to detect errors in code , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[17]  Nikolai Tillmann,et al.  Discovering Likely Method Specifications , 2006, ICFEM.

[18]  Armin Biere,et al.  High‐level data races , 2003, Softw. Test. Verification Reliab..

[19]  Claire Le Goues,et al.  Specification Mining with Few False Positives , 2009, TACAS.

[20]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

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

[22]  Nikolai Tillmann,et al.  DySy: dynamic symbolic execution for invariant inference , 2008, ICSE.

[23]  Alan Kaminsky Parallel Java: A Unified API for Shared Memory and Cluster Parallel Programming in 100% Java , 2007, 2007 IEEE International Parallel and Distributed Processing Symposium.

[24]  Sudheendra Hangal,et al.  Tracking down software bugs using automatic anomaly detection , 2002, ICSE '02.

[25]  David Evans,et al.  Dynamically inferring temporal properties , 2004, PASTE.

[26]  Barton P. Miller,et al.  Detecting Data Races in Parallel Program Executions , 1989 .

[27]  Jian Pei,et al.  Mining API patterns as partial orders from source code: from usage scenarios to specifications , 2007, ESEC-FSE '07.

[28]  Sarfraz Khurshid,et al.  Generating Representation Invariants of Structurally Complex Data , 2022 .

[29]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

[30]  Thomas R. Gross,et al.  Object race detection , 2001, OOPSLA '01.

[31]  Greg Barnes,et al.  A method for implementing lock-free shared-data structures , 1993, SPAA '93.