SOS: saving time in dynamic race detection with stationary analysis

Data races are subtle and difficult to detect errors that arise during concurrent program execution. Traditional testing techniques fail to find these errors, but recent research has shown that targeted dynamic analysis techniques can be developed to precisely detect races (i.e., no false race reports are generated) that occur during program execution. Unfortunately, precise race detection is still too expensive to be used in practice. State-of-the-art techniques still slow down program execution by a factor of eight or more. In this paper, we incorporate an optimization technique based on the observation that many thread-shared objects are written early in their lifetimes and then become read-only for the remainder of their lifetimes; these are known as stationary objects. The main contribution of our work is the insight that once a stationary object becomes thread-shared, races cannot occur. Therefore, our proposed approach does not monitor access to these objects. As such, our system only incurs an average overhead of 45% of that of an implementation of FastTrack, a low-overhead dynamic race detector. We then compared the effectiveness of our approach to de- tect races in deployed environments with that of Pacer, a sampling based race detector based on FastTrack. We found that our approach can detect over five times more races than Pacer when we budget 50% for runtime overhead.

[1]  Samuel P. Midkiff,et al.  Optimizing Array Reference Checking in Java Programs , 1998, IBM Syst. J..

[2]  Kunle Olukotun,et al.  Feedback-directed barrier optimization in a strongly isolated STM , 2009, POPL '09.

[3]  Jong-Deok Choi,et al.  Stack allocation and synchronization optimizations for Java using escape analysis , 2003, TOPL.

[4]  Beverly A. Sanders,et al.  Precise Data Race Detection in a Relaxed Memory Model Using Heuristic-Based Model Checking , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[5]  Jong-Deok Choi,et al.  Hybrid dynamic data race detection , 2003, PPoPP '03.

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

[7]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[8]  Eric Bodden Efficient hybrid typestate analysis by determining continuation-equivalent states , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[9]  Sorin Lerner,et al.  RELAY: static race detection on millions of lines of code , 2007, ESEC-FSE '07.

[10]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[11]  Matthew B. Dwyer,et al.  Monitor optimization via stutter-equivalent loop transformation , 2010, OOPSLA.

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

[13]  Michael D. Bond,et al.  PACER: proportional detection of data races , 2010, PLDI '10.

[14]  Eric Bodden,et al.  Finding programming errors earlier by evaluating runtime monitors ahead-of-time , 2008, SIGSOFT '08/FSE-16.

[15]  Ian Watson,et al.  Constraint based optimization of stationary fields , 2008, PPPJ '08.

[16]  Alexander Aiken,et al.  Effective static race detection for Java , 2006, PLDI '06.

[17]  Thomas A. Henzinger,et al.  Race checking by context inference , 2004, PLDI '04.

[18]  Kathryn S. McKinley,et al.  Dynamic object sampling for pretenuring , 2004, ISMM '04.

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

[20]  Ondrej Lhoták,et al.  Collaborative Runtime Verification with Tracematches , 2007, RV.

[21]  Madeline Diep,et al.  Reducing the Cost of Path Property Monitoring Through Sampling , 2008, 2008 23rd IEEE/ACM International Conference on Automated Software Engineering.

[22]  Serdar Tasiran,et al.  Goldilocks: a race and transaction-aware java runtime , 2007, PLDI '07.

[23]  Monica S. Lam,et al.  Automatic inference of stationary fields: a generalization of java's final fields , 2008, POPL '08.

[24]  Eran Yahav,et al.  Verifying dereference safety via expanding-scope analysis , 2008, ISSTA '08.

[25]  Eric Bodden,et al.  Clara: A Framework for Partially Evaluating Finite-State Runtime Monitors Ahead of Time , 2010, RV.

[26]  Assaf Schuster,et al.  MultiRace: efficient on-the-fly data race detection in multithreaded C++ programs: Research Articles , 2007 .

[27]  Samuel P. Midkiff,et al.  A two-phase escape analysis for parallel Java programs , 2006, 2006 International Conference on Parallel Architectures and Compilation Techniques (PACT).

[28]  Assaf Schuster,et al.  MultiRace: efficient on‐the‐fly data race detection in multithreaded C++ programs , 2007, Concurr. Comput. Pract. Exp..

[29]  Martín Abadi,et al.  Types for safe locking: Static race detection for Java , 2006, TOPL.

[30]  Christopher Unkel Stationary fields in object -oriented programs , 2009 .

[31]  Matthew B. Dwyer,et al.  Adaptive Online Program Analysis , 2007, 29th International Conference on Software Engineering (ICSE'07).

[32]  Stephen N. Freund,et al.  The RoadRunner Dynamic Analysis Framework for Concurrent Programs , 2010, PASTE '10.

[33]  Satish Narayanasamy,et al.  LiteRace: effective sampling for lightweight data-race detection , 2009, PLDI '09.

[34]  Witawas Srisa-an,et al.  Contention-aware scheduler: unlocking execution parallelism in multithreaded java programs , 2008, OOPSLA.

[35]  Vivek Sarkar,et al.  ABCD: eliminating array bounds checks on demand , 2000, PLDI '00.

[36]  Matthew B. Dwyer,et al.  Residual dynamic typestate analysis exploiting static analysis: results to reformulate and reduce the cost of dynamic analysis , 2007, ASE.

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

[38]  Assaf Schuster,et al.  Efficient on-the-fly data race detection in multithreaded C++ programs , 2003, PPoPP '03.