-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b26
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8334448 | 17.0.13-oracle | Hari Rakesh | P4 | Resolved | Fixed | b01 |
JDK-8335652 | 17.0.13 | Andrew Lu | P4 | Resolved | Fixed | b01 |
The ClassForNameLeak test includes a loop[1] that calls System.gc() in order to give some phantom references (to class loaders created earlier in the test) a chance to be enqueued for processing. When running on GraalVM, this loop sometimes does not run long enough to allow all phantom references to be enqueued, resulting in:
java.lang.RuntimeException: ClassLoader was never enqueued!
at ClassForNameLeak.main(ClassForNameLeak.java:118)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1583)
Bumping the number of loop iterations from 10 to 100 seems to reliably prevent the failure.
[1] https://github.com/openjdk/jdk/blob/09514745fc87d5a212bdf09399aa2045f02b4612/test/jdk/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java#L109-L112
java.lang.RuntimeException: ClassLoader was never enqueued!
at ClassForNameLeak.main(ClassForNameLeak.java:118)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1583)
Bumping the number of loop iterations from 10 to 100 seems to reliably prevent the failure.
[1] https://github.com/openjdk/jdk/blob/09514745fc87d5a212bdf09399aa2045f02b4612/test/jdk/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java#L109-L112
- backported by
-
JDK-8334448 ClassForNameLeak fails intermittently as the class loader hasn't been unloaded
- Resolved
-
JDK-8335652 ClassForNameLeak fails intermittently as the class loader hasn't been unloaded
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/dc3abeee
-
Commit openjdk/jdk/a23bbea9
-
Review openjdk/jdk17u-dev/2650
-
Review openjdk/jdk/14269
(1 links to)