[PATCH] test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java failed in JITed code

Jie Fu fujie at loongson.cn
Thu Jan 10 14:44:06 UTC 2019

Hi all,

My name is Jie Fu, a JVM developer at Loongson working on the MIPS port 
of OpenJDK.
I hope this is the right place to discuss the issue.

failed with "java -Xcomp RuntimeThreadInheritanceLeak".

The failure was caused by the lost of an OopMap item for "loaderRef" 
which was optimized out by the JIT with the liveness analysis optimization.
For more details, see [1].

It seems that RuntimeThreadInheritanceLeak.java is only suitable for 
testing interpreters which is not adapted to JITs at all.
Different behaviors performed by the interpreter and JITs with the same 
test case really confused us a lot.
And I think it's worth making the test also suitable for JITs.

A tiny change can fix this issue
diff -r 02e648ae46c3 
Wed Jan 09 01:06:19 2019 +0100
Thu Jan 10 20:49:22 2019 +0800
@@ -106,7 +106,10 @@
               * context class loader-- by giving it a chance to pass away.
-            System.gc();
+            while (loaderRef.get() != null) {
+                System.gc();
+                Thread.sleep(100);
+            }

                  "waiting to be notified of loader being weakly 

Could you please review it and tell me if it's OK to file a bug on JBS.


Best Regards,

More information about the core-libs-dev mailing list