On Sat, Oct 20, 2012 at 4:06 PM, Александр Ширяев
<shiryaev....@gmail.com> wrote:
> I want to catch stack overflow exceptions in my program.
> I use sigaltstack to set up alternate stack on which SIGSEGV signals should 
> processed, and siglongjmp from signal handler to jump to restore point.
>
> But in this case signal handler executes on alternate stack only once.
> In next times signal handler executes on main program stack.

Yep, known bug.  Need to add a function (with MD implementation) to
return the stack pointer from the userframe, then use that to test
whether the thread is running on its altstack instead of the current
implementation which sets a flag when a signal is delivered to a
thread that puts it on its altstack and only clears that flag when
sigreturn() is invoked.

It would be nice if you could convert your test program into something
that fits under regress/, so that we can have a test for this going
forward...


Philip Guenther

Reply via email to