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

Class loading verification failure if GC occurs in Universe::flush_dependents_on

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b04

      Backports

        Description

        If a GC (with verification enabled) occurs during _non-parallel_ class loading in the call chain

        SystemDictionary::add_to_hierarchy => Universe::flush_dependents_on => VM_Deoptimize

        then verification in SystemDictionary::verify_obj_klass_present will fail for the class currently being defined, since it is in the Loaded state but not yet added to the SystemDictionary and not added to the Placeholder table.

        The problem is easy to reproduce by adding a VM_Verify VMop in Universe::flush_dependents_on and running a test which loads classes with a non-PCL ClassLoader.

        I=M (spurious assert with verification, potential race in class loading)
        L=M (occurs only with non-parallel capable class loaders)
        W=H (no known work-around)
        updated ILW:
        I=L (spurious assert with verification, no race in class loading)
        L=M (only with non-parallel capable class loaders)
        W=L (see comments for workaround)

        The code should be deleted - since this verification isn't intended to be true. In addition, there is a comment that should be deleted that says that redefineclasses depends on this - that was my misunderstanding when I put in the comment - but checking with Dan Daugherty and David Holmes, actually redefineclasses can only get to a class in the system dictionary.

          Attachments

          1. AllocClasses.java
            2 kB
            Mikael Gerdin
          2. trigger-classload-assert.diff
            0.3 kB
            Mikael Gerdin

            Issue Links

              Activity

                People

                • Assignee:
                  coleenp Coleen Phillimore
                  Reporter:
                  mgerdin Mikael Gerdin (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: