3 ms·
> How a SIGSEGV can be handled by the program to continue execution normally need some OS specific code A JVM's use of SIGSEGV might include platform-dependent
by wahern 3y ago
> How a SIGSEGV can be handled by the program to continue execution normally need some OS specific code
A JVM's use of SIGSEGV might include platform-dependent details for recovery. But for simple application usages (e.g. eliding inlined bounds checks in a performance critical loop operating on an array) longjmp can suffice for recovery. POSIX very carefully defines async-safety and longjmp to permit jumping out of a signal handler and resuming normal execution, provided certain constraints are met, such as that the signal did not interrupt a non-async-signal-safe function.
- zozbot234 3y ago> ...such as that the signal did not interrupt a non-async-signal-safe function. So you have to disable signals prior to doing anything "non-async-signal-safe" and re-enable them thereafter? That's a pretty big "but"...