Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions

A predictive runtime analysis technique is proposed for detecting violations of safety properties from apparently successful executions of concurrent systems. In this paper we focus on concurrent systems developed using common object-oriented multithreaded programming languages, in particular, Java. Specifically, we provide an algorithm to observe execution traces of multithreaded programs and, based on appropriate code instrumentation that allows one to atomically extract a partial-order causality from a linear sequence of events, we predict other schedules that are compatible with the run. The technique uses a weak happens-before relation which orders a write of a shared variable with all its subsequent reads that occur before the next write to the variable. A permutation of the observed events is a possible execution of a program if and only if it does not contradict the weak happens-before relation. Even though an observed execution trace may not violate the given specification, our algorithm infers other possible executions (consistent with the observed execution) that violate the given specification, if such an execution exists. Therefore, it can predict concurrency errors from non-violating runs.

[1]  Grigore Rosu,et al.  Monitoring Java Programs with Java PathExplorer , 2001, RV@CAV.

[2]  Mahesh Viswanathan,et al.  Java-MaC: a Run-time Assurance Tool for Java Programs , 2001, RV@CAV.

[3]  Koushik Sen,et al.  Rule-Based Runtime Verification , 2004, VMCAI.

[4]  Colin J. Fidge,et al.  Partial orders for parallel debugging , 1988, PADD '88.

[5]  Edith Schonberg,et al.  Detecting access anomalies in programs with critical sections , 1991, PADD '91.

[6]  Mikko H. Lipasti,et al.  Verifying sequential consistency using vector clocks , 2002, SPAA '02.

[7]  Doron A. Peled,et al.  PET: An Interactive Software Testing Tool , 2000, CAV.

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

[9]  Koushik Sen,et al.  Online efficient predictive safety analysis of multithreaded programs , 2005, International Journal on Software Tools for Technology Transfer.

[10]  Friedemann Mattern,et al.  Virtual Time and Global States of Distributed Systems , 2002 .

[11]  Ozalp Babaoglu,et al.  Consistent global states of distributed systems: fundamental concepts and mechanisms , 1993 .

[12]  Koushik Sen,et al.  Runtime safety analysis of multithreaded programs , 2003, ESEC/FSE-11.

[13]  Markus Dahm Byte Code Engineering with the BCEL API , 2007 .

[14]  Grigore Rosu,et al.  Synthesizing Monitors for Safety Properties , 2002, TACAS.

[15]  Koushik Sen,et al.  Generating Optimal Monitors for Extended Regular Expressions , 2003, RV@CAV.

[16]  Doron Drusinsky,et al.  The Temporal Rover and the ATG Rover , 2000, SPIN.