Portable record/replay for Java.

A very common debugging technique is cyclic debugging. Here the programmer repeats the execution of the application and slowly zooms in on the part where he thinks an error may occur. Paramount to this scheme is that the erroneous execution can be replayed at will. Unfortunately, this is not always the case. In multi-threaded applications several threads may interact with each other in a non-deterministic manner. This may be because of e.g. synchronization operations between different threads. It is our goal to eliminate the non-determinism caused by the synchronization operations performed by the application threads. To obtain this goal, we have implemented a record/replay system [2], [5] for Java, which we call JaRec. JaRec will trace the order of the synchronization operations during the record phase and enforce that same order during the replay phase. Our main concern was the portability of the system. Hence, we have implemented the bulk of JaRec in Java, while making as little modifications to the JVM as possible. In fact, the only real modification required involves adding some code to the JVMPI library. Many existing replay system need to adapt the underlying JVM [1], [2], [6]. Furthermore, it is necessary to keep the intrusion during the record phase as small as possible, since that will ensure we record a representative execution.