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

Possible deadlock with Metaspace locks due to mixed usage of safepoint aware and non-safepoint aware locking

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • hs25
    • hs25
    • hotspot
    • b31
    • Not verified

        Allocation of metadata is protected by the per-cld Metaspace lock.
        The allocation paths always take the Metaspace locks with _no_safepoint_check_flag.

        De-allocation of metadata is similarly protected by the per-cld Metaspace lock.
        However de-allocations use a normal MutexLocker and thereby a different code path in Mutex.

        I believe this was safe until recently because we only deallocated metadata from the VM thread while safepointed but with the MethodCounters change we can now end up deallocating metadata while the VM is running.

              mgerdin Mikael Gerdin (Inactive)
              mgerdin Mikael Gerdin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: