Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8323505

Shenandoah: java/lang/runtime/ReferencedKeyTest.java fails

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              rreddy Ravi Reddy
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: