[PATCH] test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java failed in JITed code
David Holmes
david.holmes at oracle.com
Thu Jan 10 23:07:13 UTC 2019
Hi Jie,
On 11/01/2019 12:44 am, Jie Fu wrote:
> 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.
>
> test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
> 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
> test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
>
> ---
> a/test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
> Wed Jan 09 01:06:19 2019 +0100
> +++
> b/test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
> Thu Jan 10 20:49:22 2019 +0800
> @@ -106,7 +106,10 @@
> * context class loader-- by giving it a chance to pass away.
> */
> Thread.sleep(2000);
> - System.gc();
> + while (loaderRef.get() != null) {
> + System.gc();
> + Thread.sleep(100);
> + }
>
> System.err.println(
> "waiting to be notified of loader being weakly
> reachable...");
> ---------------------------------
>
> Could you please review it and tell me if it's OK to file a bug on JBS.
> Thanks.
For hotspot testing we have certain sets of tests that are run under
-Xcomp, but this is obviously not one of them. Did you discover this by
chance or because you are attempting to do broad -Xcomp testing? Not
every test will work with Xcomp (for various reasons) and we aren't
actively trying to make every test pass with Xcomp.
But by all means file a bug and fix it.
Cheers,
David
> [1]
> https://github.com/DamonFool/MyBlog/blob/master/JVM/RuntimeThreadInheritanceLeak.md
>
>
>
> Best Regards,
> Jie
>
>
More information about the core-libs-dev
mailing list