Subscribe to our blog

Your email:

Current Articles | RSS Feed RSS Feed

Enea Releases Open Source Tool for Analyzing Java Deadlocks

Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

by Ulrik Svensson

Threads are difficult. In every multi-threaded project I've been involved in, I've seen issues with deadlocks and data races. Getting it right tends to be a real challenge even for experienced developers.

After seeing these kinds of issues over and over again I started thinking about what can be done to avoid them or at least how to find them while testing. But deadlocks are difficult to catch with conventional testing and trying to verify all possible thread interleavings is usually impossible.

I was searching for existing deadlock related test tools but all I found was papers and academic proof-of-concept code, nothing that could be used for real-world testing. So I decided to invent such a testing tool myself... and it became JCarder.

JCarder is a tool that can find potential deadlocks in concurrent multi-threaded Java programs. It can analyze a program execution and tell whether a deadlock might have occurred if the threads had been scheduled differently. That is, deadlock problems can be found without triggering actual deadlocks while running the program.
 
Here is a simplified overview of what happens when analyzing a program with JCarder:

  • First, JCarder instruments the program's byte code so that all lock operations are logged to disk.
  • Next, the program continues execution as usual while logging information about its use of locks.
  • Finally, when the program has finished execution, JCarder analyzes the logged information to find deadlock problems.

JCarder was initially developed by me and a colleague as an internal testing tool used by Enea, but after Enea decided to release JCarder as open source, we started to receive external contributions and patches from an evolving open source community. Recently, we added support for more advanced filters in order to improve the analysis accuracy. Those patches will be included in the next release.

Documentation, source code and binaries are available here: http://www.jcarder.org

A new release of JCarder is planned soon.

All Posts