On Sun, Aug 12, 2012 at 10:14 AM, Miod Vallat <m...@cvs.openbsd.org> wrote in a commit message: ... > Passes the regress tests, and now devel/libsigsegv configure siglongjmp test > will not spin (this test is however flawed as it expects a signal handler > declared as running on the sigaltstack and `returning' through siglongjmp to > be invoked on the signal stack the next time the signal is raised).
I think that's a bug in our handling of the SS_ONSTACK flag. Right now, we set that flag when switching to the stack while calling a signal handler marked for alt-stack handling and *only* clear it in sigreturn() of the sigcontext from when it first went onto the stack. The means that if a thread longjumps off the alt-stack, it has no way to ever clear the flag and utilize the alt-stack again. FreeBSD and NetBSD switched at some point to the SS_ONSTACK flag being dynamically determined from the thread's current stack pointer, which makes the handling of the alt-stack more flexible without creating any contradictions. We should pull that change over, IMO. Philip Guenther