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

JVMCIEnv::get_jvmci_type does not keep klasses alive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 11, 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Erik Osterlund wrote:
        The JVMCIEnv::get_jvmci_type() function has the following block of code:

        #ifdef INCLUDE_ALL_GCS
            if (UseG1GC) {
              // The klass might have come from a weak location so enqueue
              // the Class to make sure it's noticed by G1
              G1SATBCardTableModRefBS::enqueue(klass()->java_mirror());
            }
        #endif // Klass* don't require tracking as Metadata*

        This serves the purpose of keeping the Klass alive so that the handle may be used safely. However, the INCLUDE_ALL_GCS does not exist in jdk13, and therefore, the ifdef block will not be embedded into the binary. In fact, the G1SATBCardTableModRefBS class does not exist either. Nowadays, rather than explicitly enqueueing things for G1, we use the Access API to keep things alive. So the JVMCI adaptation to jdk13 needs to adapt to that. As a result, classes are not kept alive, leading to crashes.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kvn Vladimir Kozlov
                Reporter:
                kvn Vladimir Kozlov
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: