Racer: Effective race detection using AspectJ

E Bodden, K Havelund - … of the 2008 international symposium on …, 2008 - dl.acm.org
Proceedings of the 2008 international symposium on Software testing and analysis, 2008dl.acm.org
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 …
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.
ACM Digital Library