+24
−1
Loading
on Linux/x86, the Lisp signal handler for SIGSEGV overwrites the
beginning of the control stack.
For SIGSEGV we use an extra signal stack and when the signal isn't
handled by the GC or by the stack overflow handler we call eventually
call_into_lisp. call_into_lisp tests whether the current stack
pointer points to the normal control stack. But the test fails
because we use the extra signal stack, so call_into_lisp just sets the
stack pointer to the beginning of the normal control stack. This is
not much fun for debugging because the backtrace is truncated and it's
also no longer possible to throw to the top-level-catcher because its
frame was overwritten.
I tried to fix that with the patch below. The idea is to switch back
to the normal stack before calling the Lisp handler. The patch may
not be very elegant but it is at least short :) .