Eric Bodden, Ph.D. Current conditions in Darmstadt: Broken Clouds, 14°C
14°C

Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
  • rss
  • Home
  • Research
    • Publications
    • Presentations
    • Current research
      • Inter-procedural Data-flow Analysis of Software Product Lines
      • RefaFlex – Safer refactorings for reflective Java programs
      • Join Point Interfaces
      • Stateful Breakpoints
      • MOPBox
      • Closure Joinpoints for AspectJ
      • Proving Security Properties of Services
      • TamiFlex: a tool set for Taming Reflection
    • 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
      • Clara: Compile-time Approximation of Runtime Analyses
    • Hosting a Program Committee meeting with Skype
  • Tools
    • SPLlift – highly efficient product line analysis
    • Heros – Inter-Procedural Data-Flow Analysis
    • Behavior Compliance Control
    • Join Point Interfaces
    • TamiFlex: a tool set for Taming Reflection
    • Closure Joinpoints for AspectJ
    • Clara: Compile-time Approximation of Runtime Analyses
    • RacerAJ (for race detection)
    • An introduction to Soot 2.2.5
    • J-LO, a tool for runtime-checking temporal assertions
    • Aspect-oriented approaches targeting the .NET Framework
  • Teaching
    • Current lectures and thesis topics
    • Past lectures
      • Automated Software Engineering
      • Software-Engineering Project
      • COMP 520
      • COMP 621
  • About me
  • Photos

RacerAJ (for race detection)

Quick link: download RacerAJ version 1.0 or Racer version 2.0 (with support for Thread.start())

image

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 one of the following packages.

  • RacerAJ version 1.0 (ZIP file, released May 8th, 2008, GPL3)
    This is the version described in our ISSTA 2008 paper, which won an ACM Distinguished Paper Award.
  • RacerAJ version 2.0 (ZIP file, released May 9th, 2012, GPL3)
    This is the version described in our TSE paper. Opposed to the 1.0 version, this one supports a sound modeling of Thread.start() events.

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.

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.

Upcoming Conferences

SC 2013

SOAP 2013

ESEC/FSE 2013

PPPJ 2013

RV 2013

Photos

Categories & Feeds

  • Research
    RSS
    (176)
  • Misc
    RSS
    (99)
  • Montreal
    RSS
    (44)

Collaborations

  • Don Batory, UTA
  • Eric Tanter, Universidad de Chile
  • Friedrich Steimann, Fernuni Hagen
  • Grigore Rosu, UIUC
  • Hans Vangheluwe, McGill University/Universiteit Antwerpen
  • Jacques Klein, SnT Luxembourg
  • Klaus Havelund, NASA JPL
  • Laurie Hendren, McGill University
  • Martin Monperrus, Univ. of Lille
  • Matthew Dwyer, University of Nebraska
  • Oege de Moor, University of Oxford
  • Ondrej Lhotak, University of Waterloo
  • Patrick Lam, University of Waterloo
  • Rahul Purandare
  • Sarfraz Khurshid, UTA
  • Shahar Maoz, RWTH Aachen
  • Tian Zhao, UW Milwaukee
  • Volker Stolz, University of Oslo

Research projects

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

Service

  • AOSD 2006
  • AOSD 2007
  • AOSD 2010
  • AOSD 2011
  • AOSD 2012
  • ATPS 2013
  • ATVA 2008
  • ECOOP 2008 Doctoral Symposium
  • ECOOP 2010
  • ESEC/FSE 2011 New Ideas Track
  • ESEC/FSE 2013
  • FOAL 2010
  • FOAL 2012
  • FOAL 2013
  • ICSE 2010
  • ICSE 2013 (New Ideas)
  • IEEE Transactions on Software Engineering (TSE)
  • International Journal of Image and Graphics
  • ISSTA 2011
  • NFM 2011
  • OOPSLA 2008
  • OOPSLA 2010
  • OOPSLA 2012
  • PEPM 2008
  • PLDI 2006
  • PLDI 2008
  • RAM-SE 2011
  • RV 2007
  • RV 2009
  • RV 2010
  • RV 2011
  • SAC 2012
  • SC 2011
  • SC 2013
  • SEFM 2005
  • SEFM 2008
  • Transactions on Software Engineering and Methodology (TOSEM)
  • VMIL 2008
  • VMIL 2009

Some other people I know

  • Adrian Colyer
  • Bruno Dufour
  • Dan North
  • Daniel Klink
  • Dave Thomas
  • Dean Wampler
  • Eric Tanter
  • Friedrich Steimann
  • Joachim Kneis
  • Klaus Havelund
  • Kristin Lovejoy
  • 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
  • Master Sgt. Eric Bodden

Previous Posts

May 2013
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Tags

Alumni AOP AOSD AspectJ Atlanta Bike Blizzard Bug finding Caro Clara COMP 621 Eclipse FSE Google ISSTA Java LinkedIn Mac McGill Microsoft Montreal NASA Photos Programming Quebec City Race detection Racer Runtime Monitoring Runtime verification RV RWTH Seattle Slides Snow storm Soot Soot Tutorial Static Analysis Strike TamiFlex TA strike Thesis tracematches Typestate Vacation Winter carnival


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