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

Exceptions thrown during upcalls should be handled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      Currently, if an exception is thrown one of several things can happen:

      - If the upcall is specialized, the VM crashes with a fatal error (though the exception is handled explicitly in native code)
      - If the upcall is interpreted, the exception will be handled when returning from a downcall earlier on the same thread (but any native code in between will be unaware of the exception)

      Neither of these are desirable. JNI can handle the latter case because native code can detect the exception and handle it appropriately, but in our case, the native code has no idea about exception.

      We think that the best way to handle exceptions thrown during upcalls is to do some error reporting, and then call System.exit, to avoid any trouble with unsuspecting native code we're about to return to.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jvernee Jorn Vernee
              Reporter:
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: