Re:macOS Sonoma 14.4 might break Java on your machine
by zozbot234 on Monday March 18, 2024 @06:55AM
(#39742369)
> ...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"...
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.