JDK-8301264 : runtime/ClassUnload/DictionaryDependsTest.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: linux
  • CPU: x86_64
  • Submitted: 2023-01-27
  • 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/DictionaryDependsTest.java

Here's a snippet from the log file:

#section:main
----------messages:(7/563)----------
command: main -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -Xlog:class+unload -XX:+WhiteBoxAPI DictionaryDependsTest
reason: User specified action: run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -Xlog:class+unload -XX:+WhiteBoxAPI DictionaryDependsTest 
started: Fri Jan 27 17:01:22 UTC 2023
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base,java.compiler --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
finished: Fri Jan 27 17:01:22 UTC 2023
elapsed time (seconds): 0.444
----------configuration:(4/111)----------
Boot Layer
  add modules: java.base java.compiler     
  add exports: java.base/jdk.internal.misc ALL-UNNAMED

----------System.out:(15/1247)----------
name is DictionaryDependsTest$c1r
name is p2.c2
c2 method2 called
[0.261s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801007000 0x0000000801007000
[0.261s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801006c00 0x0000000801006c00
[0.261s][info][class,unload] unloading class java.lang.invoke.LambdaForm$DMH/0x0000000801006800 0x0000000801006800
[0.261s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801004000 0x0000000801004000
[0.262s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801003800 0x0000000801003800
[0.262s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801000400 0x0000000801000400
c2 method2 called
[0.335s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801000400 0x0000000801000400
[0.335s][info][class,unload] unloading class java.lang.invoke.LambdaForm$MH/0x0000000801003800 0x0000000801003800
[0.335s][info][class,unload] unloading class java.lang.invoke.LambdaForm$DMH/0x0000000801004000 0x0000000801004000
Should not unload anything before here because class DictionaryDependsTest$c1r is still alive.
Should unload MyTest and p2.c2 just now
----------System.err:(12/830)----------
jdk.test.lib.classloader.ClassUnloadCommon$TestFailure: Test failed: should be unloaded
	at jdk.test.lib.classloader.ClassUnloadCommon.failIf(ClassUnloadCommon.java:51)
	at DictionaryDependsTest.main(DictionaryDependsTest.java:87)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	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:(44/8489)*----------
Comments
This is a duplicate of JDK-8299276. See that bug for more info.
17-03-2023