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

ZGC: Broken oop map in C1 load barrier stub

XMLWordPrintable

    • gc
    • b30
    • Verified

        The C1 load barrier stub for ZGC can emit a patching area for a lea instruction. However, the call into the VM to do the patching at this site is not associated with a proper oop map. As a result, we can end up with a stale oop in the base pointer register if a GC safepoint happens when we enter the VM to patch.

        This problem is not super easy to reproduce by default, but is a serious bug when it happens. However, it is fairly easy to reproduce when also injecting a small delay in the ZNMethodTable::register_nmethod().

        The proposed solution is to never allow patching to happen inside the load barrier stub. Instead, if patching is needed, we emit the lea instruction as part of the load preceding the load barrier. That will automatically generate the proper oop map for the patch site.

              pliden Per Liden (Inactive)
              pliden Per Liden (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: