Exceptions in native code
White_145
white145gaming at gmail.com
Mon Apr 28 12:11:42 UTC 2025
Whenever C code uses exceptions (in my case raised by `RaiseException`
(windows) or `_Unwind_RaiseException` (linux)) and java takes control of
the execution, it crashes the VM with an "Internal Error" message.
I'm using bindings for LuaJIT, and it raises exceptions quite a lot for the
purpose of stack unwinding. Most of them are easy to avoid: errors and
yields can be simply wrapped by a C function so that java doesn't see it,
but others, signaling for Out Of Memory, are not so straightforward.
Is there a way to handle (perhaps, convert to a Java Exception?) these
native exceptions before Java crashes the VM, given that the error code is
known? If not, is it planned/possible in the future?
I have little experience in this kind of problem: in fact, my only
experience is trying to deal with it, so be free to call out the wrong
terminology and/or approach. I have been searching for a solution [what
seems to be] everywhere, but I haven't found anyone with the same problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20250428/970bf99a/attachment.htm>
More information about the panama-dev
mailing list