Base implementation of catching exceptions made in C stubs#433
Base implementation of catching exceptions made in C stubs#433SturdyPose wants to merge 15 commits intomirage:mainfrom
Conversation
MisterDA
left a comment
There was a problem hiding this comment.
There's a bit of mixed indentation in the C file, please reformat the Windows code to be consistent with the rest.
|
Applied clang-format on source |
|
Seems like windows containers are broken because they don't have npm and I'm unsure why mac is not catching the exception... 🤔 |
|
Yeah, I'll need to rethink the implementation of reporting it back to ocaml -> might not be possible at all. There can be stack corruption and that would lead to undeterministic results. Do you think that reporting it to stderr would be good enough? |
|
For the unix part maybe you need a signal handler on the ocaml side instead? |
|
Well from what I gathered online is that signals can be interpreted differently for each unix like system. For example apple platform is handling signals differently than linux systems, and even linux distros themselves can handle those differently, so I reckon that it won't make much difference adding signal handler on ocaml side. There's also problem when you throw a signal like SEGFAULT, you can't reliably catch it and especially returning back to ocaml's managed memory. I think that only course of action is to just print into stderror. Such a headache. :D |
The goal of this PR is to fix #430
Open to any feedback. :)