-
Bug
-
Resolution: Duplicate
-
P4
-
21
In jdk21u-dev testing, caught a test failure with Shenandoah:
```
$ CONF=linux-x86_64-server-fastdebug make images test TEST=java/lang/runtime/ReferencedKeyTest.java TEST_VM_OPTS="-XX:+UseShenandoahGC"
TEST: java/lang/runtime/ReferencedKeyTest.java
java.lang.ClassCastException: class java.lang.runtime.SoftReferenceKey cannot be cast to class java.lang.runtime.WeakReferenceKey (java.lang.runtime.SoftReferenceKey and java.lang.runtime.WeakReferenceKey are in module java.base of loader 'bootstrap')
at java.base/java.lang.runtime.ReferencedKeyMap.removeStaleReferences(ReferencedKeyMap.java:326)
at java.base/java.lang.runtime.ReferencedKeyMap.put(ReferencedKeyMap.java:209)
at java.base/java.lang.runtime.ReferencedKeyTest.populate(ReferencedKeyTest.java:106)
at java.base/java.lang.runtime.ReferencedKeyTest.mapTest(ReferencedKeyTest.java:61)
at java.base/java.lang.runtime.ReferencedKeyTest.main(ReferencedKeyTest.java:45)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1583)
```
I actually suspect this is a test bug, as it looks like we are leaking the references of one type to another test through the reference queue.
```
$ CONF=linux-x86_64-server-fastdebug make images test TEST=java/lang/runtime/ReferencedKeyTest.java TEST_VM_OPTS="-XX:+UseShenandoahGC"
TEST: java/lang/runtime/ReferencedKeyTest.java
java.lang.ClassCastException: class java.lang.runtime.SoftReferenceKey cannot be cast to class java.lang.runtime.WeakReferenceKey (java.lang.runtime.SoftReferenceKey and java.lang.runtime.WeakReferenceKey are in module java.base of loader 'bootstrap')
at java.base/java.lang.runtime.ReferencedKeyMap.removeStaleReferences(ReferencedKeyMap.java:326)
at java.base/java.lang.runtime.ReferencedKeyMap.put(ReferencedKeyMap.java:209)
at java.base/java.lang.runtime.ReferencedKeyTest.populate(ReferencedKeyTest.java:106)
at java.base/java.lang.runtime.ReferencedKeyTest.mapTest(ReferencedKeyTest.java:61)
at java.base/java.lang.runtime.ReferencedKeyTest.main(ReferencedKeyTest.java:45)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1583)
```
I actually suspect this is a test bug, as it looks like we are leaking the references of one type to another test through the reference queue.
- duplicates
-
JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared
- Resolved
- relates to
-
JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared
- Resolved