Eric Bodden Current conditions in Darmstadt: Cloud and Visibility OK, 2°C (feels like -1°C)
2°C

Easy and efficient software verification
  • rss
  • Home
  • Research
    • Past Research
      • Efficient Runtime Verification
      • Racer: Effective Race Detection Using AspectJ
      • Continuation-equivalent states (ICSE 2010)
      • Aspect-oriented programming and design
      • Visual specification languages
      • A denial-of-service attack on the Java bytecode verifier
    • Publications
    • Presentations
  • Tools
    • Clara: Compile-time Approximation of Runtime Analyses
    • RacerAJ (for race detection)
    • An introduction to Soot 2.2.5
    • Aspect-oriented approaches targeting the .NET Framework
  • Teaching
    • Automated Software Engineering
    • Software-Engineering Project
    • COMP 520
    • COMP 621
  • Legacy
    • Bad Sector Recovery on NTFS
    • Arithmetic Coding
    • PHP Scripts
  • About me
  • Photos

RacerAJ (for race detection)

Quick link: download RacerAJ version 1.0

imageUpdate: The Racer paper won an ACM Distinguished Paper Award at ISSTA 2008.

RacerAJ is an AspectJ based implementation of the Racer algorithm, a variant of Eraser. It allows you to detect data races in Java and AspectJ programs at runtime. The implementation of RacerAJ is based on three novel pointcuts that we implemented as an extension to the AspectBench Compiler.

  • lock() matches whenever one enters a synchronized block or synchronized method
    • one can use lock() && args(l) to expose the lock l to the advice
  • unlock() matches whenever one exits a synchronized block or synchronized method
    • one can use unlock() && args(l) to expose the lock l to the advice
  • maybeShared(), a “semantic pointcut,” matches any field access (set or get), but only those that may be accessing shared fields; in particular we apply a static thread-local objects analysis to make it match on as few unshared field accesses as possible – this can speed up runtime evaluation

The ajc compiler also supports the first two pointcuts if you give it the -Xjoinpoints:synchronization option. However, the maybeShared() pointcut only exists in the latest version of abc.

Using RacerAJ to find races in your programs

To apply RacerAJ to your Java or AspectJ program download the following package.

  • RacerAJ version 1.0 (ZIP file, released May 8th, 2008, GPL3)

This package contains a src folder holding all aspects and classes that implement RacerAJ. RacerAJ consists mainly of the following two aspects:

  • Locking.aj – this file keeps track of lock sets
  • Racer.aj – this aspect keeps tracks of (potentially shared) field accesses and implements the main logic

Furthermore, the download package contains a current version of the abc compiler that implements the three new pointcuts mentioned above.

Compilation with abc

To compile your programs with abc, and to enable these new pointcuts you have to pass the following arguments to abc:

… -ext abc.ja.eaj -debug enableLockPointcuts -sourceroots src:yourSourceFolder1:yourSourceFolder2 -outjar out.jar

The flag “-ext abc.ja.eaj” tells abc to use the new JastAdd based frontend, which supports Java 5 syntax. The flag “-debug enableLockPointcuts” tells abc to enable the lock() and unlock() pointcuts. By default they are disabled to avoid “keyword stealing”. The other arguments tell abc to include RacerAJ’s source folder “src” and you own source folders, and the JAR file in which abc should put the woven classes.

Enabling static optimization of maybeShared()

By default abc will consider maybeShared() be always true, i.e. the pointcut will match any field set or get. to enable our static whole-program optimizations, use the following additional argument:

-debug optimizeMaybeSharedPointcut

For more help on abc command line options, please consult this document.

Compilation with ajc

You can also compile RacerAJ with ajc if you like. The only problem is that ajc does not support the maybeShared() pointcut. Therefore you have to add the following definition to the Racer.aj file:

pointcut maybeShared(): if(true);

This will just make ajc assume that all field accesses may be shared. This is has the same effect as using abc without giving the “-debug optimizeMaybeSharedPointcut” option.

To enable lock() and unlock() pointcuts in ajc, pass this command line option:

-Xjoinpoints:synchronization

(If you use AJDT in Eclipse, you can set the option in the project’s preferences.)
Furthermore you have to make sure that abc-runtime.jar from the above distribution is on your classpath. This is because RacerAJ makes use of WeakIdentityHashMaps that are part of this library.

Running RacerAJ

To run your program with RacerAJ enabled, simply run the woven binary with abc-runtime.jar on your classpath. If and when RacerAJ detects a race it will give you output as follows, indicating a data race on the field shared in this example code:

==========================
Race condition found!
Field 'static int Task.shared' is accessed unprotected.
Owner object: 1743665428
==========================

ca.mcgill.sable.racer.Read at Task.java:7
ca.mcgill.sable.racer.Write at Task.java:7

--------------------------

Using lock(), unlock() and maybeShared() pointcuts for your own algorithms

We designed our extension to abc specifically in such a way that other researchers could use it to implement their own race detection, deadlock detection and I don’t know what algorithms using these novel pointcuts. Simply use the same command line shown above and have fun with the language extension!

The pointcuts are already contained in abc version 1.3.0, however only in the package “abc.eaj”, which supports Java 1.4 syntax. For Java 5 support you have to use “abc.ja.eaj”, contained in abc-complete.jar in the above download package.

Citing Racer

You can use the following to cite us:

publications.bib bibtex file not found

publications.bib bibtex file not found

Comments rss
Comments rss
Trackback
Trackback

Leave a Reply

Click here to cancel reply.

Welcome

Welcome to my website. Interested in my research? Click here for details or jump directly to my publications.

Pages

  • Research
    • Past Research
      • Continuation-equivalent states (ICSE 2010)
      • Efficient Runtime Verification
      • Racer: Effective Race Detection Using AspectJ
      • Aspect-oriented programming and design
      • Visual specification languages
      • A denial-of-service attack on the Java bytecode verifier
    • Publications
    • Presentations
  • Tools
    • Clara: Compile-time Approximation of Runtime Analyses
    • RacerAJ (for race detection)
    • An introduction to Soot 2.2.5
    • Aspect-oriented approaches targeting the .NET Framework
  • Teaching
    • Automated Software Engineering
    • Software-Engineering Project
    • COMP 520
    • COMP 621
  • Legacy
    • Arithmetic Coding
    • Bad Sector Recovery on NTFS
    • PHP Scripts
  • About me

Categories & Feeds

  • Misc RSS Feed Icon (89)
  • Montreal Blog RSS Feed Icon (44)
  • Research Blog RSS Feed Icon (67)
  • Comments (RSS) RSS Feed Icon

Kitchensink

  • Conferences
  • My first patent: Method and system for performance profiling of software (pending)
  • Photos

Research projects

  • AspectBench Compiler (abc)
  • J-LO
  • Soot
  • Stratified aspects

Service

  • AOSD 2006
  • AOSD 2007
  • AOSD 2010
  • AOSD 2011
  • Association of Alumni, Friends, and Supporters of the RWTH Aachen University in North America
  • ATVA 2008
  • ECOOP 2008 Doctoral Symposium
  • ECOOP 2010
  • FOAL 2010
  • IEEE Transactions on Software Engineering (TSE)
  • International Journal of Image and Graphics
  • ISSTA 2011
  • OOPSLA 2008
  • PEPM 2008
  • PLDI 2006
  • PLDI 2008
  • RV 2007
  • RV 2009
  • RV 2010
  • SEFM 2005
  • SEFM 2008
  • Transactions on Software Engineering and Methodology (TOSEM)
  • VMIL 2008
  • VMIL 2009

Some of my colleagues

  • Gregory Prokopski
  • Laurie Hendren
  • Nomair Naeem
  • Ondrej Lhotak
  • Patrick Lam
  • Programming Tools Group
  • Sable lab

Some other people I know

  • Adrian Colyer
  • Bruno Dufour
  • Dan North
  • Daniel Klink
  • Dave Thomas
  • Dean Wampler
  • Friedrich Steimann
  • Joachim Kneis
  • Klaus Havelund
  • Liz Keogh
  • Malte Clasen
  • Markus Schorn
  • Pascal Costanza
  • Patricia Jablonski
  • Philip Mayer
  • Ron Bodkin
  • Sven Wittig
  • Wiebke Berg

Some people not to confuse me with

  • Eric B. the terrorist
  • Eric Bodden the basketball player
  • Eric Bodden the chef who sunk
  • Eric Christopher Bodden
  • Noel R. Lopez alias Eric Bodden

Previous posts

March 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

Alumni AspectJ Atlanta Blizzard Bug finding Clara COMP 621 Eclipse Flight FSE Google ISSTA Java LinkedIn Mac McGill Microsoft Montreal Blog OOPSLA Oxford Photos Politics Programming Quebec City Race detection Racer Random ranting Runtime verification RWTH Seattle Ski trip Snow Snow storm Soot Soot Tutorial Static Analysis Strike TA strike Thesis tracematches Typestate Vacation Website Winter carnival Wordpress


rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox