Racer: effective race detection using aspectj

Programming errors occur frequently in large software systems, and even more so if these systems are concurrent. In the past researchers have developed specialized programs to aid programmers detecting concurrent programming errors such as deadlocks, livelocks, starvation and data races. In this work we propose a language extension to the aspect-oriented programming language AspectJ, in the form of three new pointcuts, lock(), unlock() and maybeShared(). These pointcuts allow programmers to monitor program events where locks are granted or handed back, and where values are accessed that may be shared amongst multiple Java threads. We decide thread-locality using a static thread-local objects analysis developed by others. Using the three new primitive pointcuts, researchers can directly implement efficient monitoring algorithms to detect concurrent programming errors online. As an example, we expose a new algorithm which we call Racer, an adoption of the well-known Eraser algorithm to the memory model of Java. We implemented the new pointcuts as an extension to the AspectBench Compiler, implemented the Racer algorithm using this language extension and then applied the algorithm to the NASA K9 Rover Executive. Our experiments proved our implementation very effective. In the Rover Executive Racer finds 70 data races. Only one of these races was previously known. We further applied the algorithm to two other multi-threaded programs written by Computer Science researchers, in which we found races as well.

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

[2]  Ondrej Lhoták,et al.  Scaling Java Points-to Analysis Using SPARK , 2003, CC.

[3]  David Holmes,et al.  Java Concurrency in Practice , 2006 .

[4]  Allen Goldberg,et al.  Instrumentation of Java Bytecode for Runtime Analysis , 2003 .

[5]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[6]  Doug Lea,et al.  Concurrent programming in Java - design principles and patterns , 1996, Java series.

[7]  Guy L. Steele,et al.  Java(TM) Language Specification , 2005 .

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

[9]  Eric Bodden,et al.  Avoiding Infinite Recursion with Stratified Aspects , 2006, NODe/GSEM.

[10]  Michael Eichberg,et al.  Pointcuts as Functional Queries , 2004, APLAS.

[11]  Hidehiko Masuhara,et al.  Compiling Conditional Pointcuts for User-Level Semantic Pointcuts , 2005 .

[12]  Gregg Rothermel,et al.  Sofya: Supporting Rapid Development of Dynamic Program Analyses for Java , 2007, 29th International Conference on Software Engineering (ICSE'07 Companion).

[13]  Klaus Havelund,et al.  Confirmation of deadlock potentials detected by runtime analysis , 2006, PADTAD '06.

[14]  Michael R. Lowry,et al.  Experimental Evaluation of Verification and Validation Tools on Martian Rover Software , 2013, Formal Methods Syst. Des..

[15]  Ondrej Lhoták,et al.  Adding trace matching with free variables to AspectJ , 2005, OOPSLA '05.

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

[17]  Ondrej Lhoták,et al.  A Staged Static Program Analysis to Improve the Performance of Runtime Monitoring , 2007, ECOOP.

[18]  Yaron Wolfsthal,et al.  Hardware and software verification and testing : First International Haifa Verification Conference, Haifa, Israel, November 13-16, 2005. revised selected papers , 2006 .

[19]  Amitabh Srivastava,et al.  Analysis Tools , 2019, Public Transportation Systems.

[20]  Volker Stolz,et al.  Temporal Assertions using AspectJ , 2006, Electron. Notes Theor. Comput. Sci..

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

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

[23]  Clark Verbrugge,et al.  Component-Based Lock Allocation , 2007, 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007).

[24]  Eric Bodden,et al.  Static Analysis Techniques for Evaluating Runtime Monitoring Properties Ahead-of-Time , 2007 .

[25]  Klaus Havelund,et al.  Dynamic Deadlock Analysis of Multi-threaded Programs , 2005, Haifa Verification Conference.

[26]  Klaus Havelund,et al.  Towards a framework and a benchmark for testing tools for multi-threaded programs: Research Articles , 2007 .

[27]  Klaus Havelund,et al.  Towards a framework and a benchmark for testing tools for multi‐threaded programs , 2007, Concurr. Comput. Pract. Exp..

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

[29]  Marcelo d'Amorim,et al.  Event-based runtime verification of java programs , 2005, ACM SIGSOFT Softw. Eng. Notes.

[30]  Klaus Havelund,et al.  Model checking programs , 2000, Proceedings ASE 2000. Fifteenth IEEE International Conference on Automated Software Engineering.

[31]  Ondrej Lhoták,et al.  abc : An Extensible AspectJ Compiler , 2006, LNCS Trans. Aspect Oriented Softw. Dev..

[32]  Yaron Wolfsthal,et al.  Hardware and Software, Verification and Testing: First International Haifa Verification Conference, Haifa, Israel, November 13-16, 2005, Revised Selected Papers (Lecture Notes in Computer Science) , 2006 .

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

[34]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

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

[36]  Hugh L. Dryden,et al.  THE NATIONAL AERONAUTICS AND SPACE ADMINISTRATION , 1958 .

[37]  Grigore Rosu,et al.  An Overview of the Runtime Verification Tool Java PathExplorer , 2004, Formal Methods Syst. Des..

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

[39]  Armin Biere,et al.  Using Block-Local Atomicity to Detect Stale-Value Concurrency Errors , 2004, ATVA.

[40]  Jerry J. Harrow Runtime Checking of Multithreaded Applications with Visual Threads , 2000, SPIN.

[41]  Thierry Coupaye,et al.  ASM: a code manipulation tool to implement adaptable systems , 2002 .

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