JDK-8303032 : runtime/ClassUnload/KeepAliveClassLoader.java fails with "Test failed: should be unloaded"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2023-02-21
  • Updated: 2023-03-17
  • Resolved: 2023-03-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK21 CI:

runtime/ClassUnload/KeepAliveClassLoader.java

Here's a snippet from the log file:

#section:main
----------messages:(7/509)----------
command: main -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClassLoader
reason: User specified action: run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClassLoader 
started: Mon Feb 20 17:17:51 GMT 2023
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
finished: Mon Feb 20 17:17:52 GMT 2023
elapsed time (seconds): 0.998
----------configuration:(4/111)----------
Boot Layer
  add modules: java.base                   
  add exports: java.base/jdk.internal.misc ALL-UNNAMED

----------System.out:(3/96)----------
testClassLoader (1) alive: true
testClassLoader (2) alive: true
testClassLoader (3) alive: true
----------System.err:(12/828)----------
jdk.test.lib.classloader.ClassUnloadCommon$TestFailure: Test failed: should be unloaded
	at jdk.test.lib.classloader.ClassUnloadCommon.failIf(ClassUnloadCommon.java:51)
	at KeepAliveClassLoader.main(KeepAliveClassLoader.java:76)
	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$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1623)

JavaTest Message: Test threw exception: jdk.test.lib.classloader.ClassUnloadCommon$TestFailure: Test failed: should be unloaded
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: jdk.test.lib.classloader.ClassUnloadCommon$TestFailure: Test failed: should be unloaded
----------rerun:(42/10039)*----------
Comments
This is a duplicate of JDK-8299276. See that bug for more info.
17-03-2023