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

Metaspace::contains() should be threadsafe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8, 11, 17, 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      Metaspace::contains() is used in many places. It is not threadsafe since it walks the list of metaspace mappings, which can be altered concurrently. This is suspected to be the cause for JDK-8271124.

      This is a day zero bug of metaspace, in there since JDK 8. Weirdly enough it never surfaced until now.

      Currently, it does not lock, and adding a lock is not realistic either. It should work lockless. (See discussion in comment section of JDK-8271124).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stuefe Thomas Stuefe
              Reporter:
              stuefe Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: