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

ZGC: Broken oop map in C1 load barrier stub

    XMLWordPrintable

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b30
    • Verification:
      Verified

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pliden Per Liden
                  Reporter:
                  pliden Per Liden
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: