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

[JVMCI] HotSpotJVMCIRuntime.encodeThrowable should not throw an exception

    XMLWordPrintable

Details

    • b26

    Backports

      Description

        JVMCI has a mechanism for translating exceptions from libjvmci to HotSpot and vice versa. This is important for proper error handling when a thread calls between these 2 runtime heaps.

        This translation mechanism itself needs to be robust in the context of resource limits, especially heap limits, as it may be translating an OutOfMemoryError from HotSpot back into libjvmci. The existing code in HotSpotJVMCIRuntime.encodeThrowable[1] and TranslatedException.encodeThrowable[2] should handle translation failures by falling back to non-allocating code. However, we still see a rare OOME that breaks the translation mechanism (e.g., https://github.com/oracle/graal/issues/5470#issuecomment-1321749688). One possibility for this is an OOME rematerializing oops during a deoptimization causing an unexpected execution path. The exception translation code should be made more robust against such paths.

        [1] https://github.com/graalvm/labs-openjdk-17/blob/f6b18b596fa5acb1ab7efa10e284d106669040a6/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java#L237
        [2] https://github.com/graalvm/labs-openjdk-17/blob/f6b18b596fa5acb1ab7efa10e284d106669040a6/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/TranslatedException.java#L153

        Attachments

          Issue Links

            Activity

              People

                dnsimon Douglas Simon
                dnsimon Douglas Simon
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: