HAVE: Detecting Atomicity Violations via Integrated Dynamic and Static Analysis

The reality of multi-core hardware has made concurrent programs pervasive. Unfortunately, writing correct concurrent programs is difficult. Atomicity violation, which is caused by concurrently executing code unexpectedly violating the atomicity of a code segment, is one of the most common concurrency errors. However, atomicity violations are hard to find using traditional testing and debugging techniques. This paper presents a hybrid approach that integrates static and dynamic analyses to attack this problem. We first perform static analysis to obtain summaries of synchronizations and accesses to shared variables. The static summaries are then instantiated with runtime values during dynamic executions to speculatively approximate the behaviors of branches that are not taken. Compared to dynamic analysis, the hybrid approach is able to detect atomicity violations in unexecuted parts of the code. Compared to static analysis, the hybrid approach produces fewer false alarms. We implemented this hybrid analysis in a tool called HAVE that detects atomicity violations in multi-threaded Java programs. Experiments on several benchmarks and real-world applications demonstrate promising results.

[1]  Cormac Flanagan,et al.  Verifying Commit-Atomicity Using Model-Checking , 2004, SPIN.

[2]  Stephen N. Freund,et al.  Atomizer: A dynamic atomicity checker for multithreaded programs , 2008, Sci. Comput. Program..

[3]  Matthew B. Dwyer,et al.  Verifying Atomicity Specifications for Concurrent Object-Oriented Software Using Model-Checking , 2004, VMCAI.

[4]  Kousha Etessami,et al.  Analysis of Recursive Game Graphs Using Data Flow Equations , 2004, VMCAI.

[5]  Rahul Agarwal,et al.  Optimized run-time race detection and atomicity checking using partial discovered types , 2005, ASE.

[6]  Azadeh Farzan,et al.  Monitoring Atomicity in Concurrent Programs , 2008, CAV.

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

[8]  Scott D. Stoller,et al.  Accurate and efficient runtime detection of atomicity errors in concurrent programs , 2006, PPoPP '06.

[9]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[10]  Min Xu,et al.  A serializability violation detector for shared-memory server programs , 2005, PLDI '05.

[11]  Stephen N. Freund,et al.  Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs , 2008, PLDI '08.

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

[13]  Scott D. Stoller,et al.  Run-Time Analysis for Atomicity , 2003, RV@CAV.

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

[15]  Andreas Podelski,et al.  ACSAR: Software Model Checking with Transfinite Refinement , 2007, SPIN.

[16]  Azadeh Farzan,et al.  Causal Atomicity , 2006, CAV.

[17]  Serdar Tasiran,et al.  A Causality-Based Runtime Check for (Rollback) Atomicity , 2007 .

[18]  Stephen N. Freund,et al.  Exploiting purity for atomicity , 2004, IEEE Transactions on Software Engineering.

[19]  Scott D. Stoller,et al.  Runtime analysis of atomicity for multithreaded programs , 2006, IEEE Transactions on Software Engineering.

[20]  Koushik Sen,et al.  Randomized active atomicity violation detection in concurrent programs , 2008, SIGSOFT '08/FSE-16.

[21]  Baowen Xu,et al.  Dependence analysis for recursive java programs , 2001, SIGP.

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

[23]  Rahul Agarwal,et al.  Detecting Potential Deadlocks with Static Analysis and Run-Time Monitoring , 2005, Haifa Verification Conference.

[24]  Rahul Agarwal,et al.  Automated type-based analysis of data races and atomicity , 2005, PPoPP.

[25]  Scott D. Stoller,et al.  Static analysis of atomicity for programs with non-blocking synchronization , 2005, PPoPP.

[26]  Rupak Majumdar,et al.  Hybrid Concolic Testing , 2007, 29th International Conference on Software Engineering (ICSE'07).

[27]  Yuanyuan Zhou,et al.  AVIO: Detecting Atomicity Violations via Access-Interleaving Invariants , 2007, IEEE Micro.