libjava testsuite failures (regressions 3.2 -> 3.3)

Jeff Sturm jsturm@one-point.com
Sat Jan 18 03:57:00 GMT 2003


On 17 Jan 2003, Tom Tromey wrote:
> Matthias> +WARNING: program timed out.
> Matthias> +FAIL: SyncTest execution - gij test
> Matthias> +WARNING: program timed out.
> Matthias> +FAIL: SyncTest execution - gij test
>
> I see this one too but I haven't investigated.  This could be a real
> regression.  Or it could just be that gij is very slow.

Indeed.  What's interesting about this example is that the gij test takes
over 60 seconds on my x86-linux laptop if compiled with gcj -C, but
finishes in only 4 seconds if compiled with javac!

Without looking at the bytecode, I'd guess javac is hoisting the
SyncTest.class lookup out of the while loop, whereas gcj -C performs no
optimizations.

Doing this by hand might be appropriate for the test case, to prevent
annoying timeouts:

--- SyncTest.java       Fri Jan 17 22:42:38 2003
+++ SyncTest.new        Fri Jan 17 22:49:48 2003
@@ -3,8 +3,9 @@
   static int counter;

   public void run() {
+    Object lock = SyncTest.class;
     for (int n = 0; n < 1000000; n++)
-      synchronized (SyncTest.class) {
+      synchronized (lock) {
         counter++;
       }
   }




More information about the Java mailing list