-
Bug
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
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.
- 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.
- relates to
-
JDK-8268328 Upstream: 8267989: Exceptions thrown during upcalls should be handled (Pt. 1)
- Closed