Re: SA_STACK

Melvin Smith (msmith@quix.robins.af.mil)
Thu, 23 May 1996 16:27:25 -0400 (EDT)


> OK, I've found an SVR4 box here that I can log-on to (I'm a contractor
> here, and only just found out they had such a beast).
> It's an DGUX 5.4R3.10, and I've normally found that DG are pretty
[snip]
> 2) setjmp() and sigsetjmp() do _not_ store the current stack, or
> if they do, longjmp() and siglongjmp() ignore it. When in a
> signal handler, running on an alt-stack, performs a *longjmp()
> the process continues running on the alt-stack (at least a call
> to altsigstack() reports the alt-stack is in use). You were
> right, this is wrong - simply returning from a function after a
> *longjmp() causes a core dump!!!!

Hmm, according to libc source, bp and sp are saved. So I would assume
Linux setjmp()/longjmp() work like the DGUX setcontext()/getcontext() ?
What is the desireable action? Even in the semantics of setjmp()/longjmp()
you HAVE to store/restore stack or it is pretty useless.

> If you're *setjmp()/*longjmp() routines are working correctly with
> alt-stacks, congradulations(sp?). I'm still v. much in favour of
> having a get/setcontext(), but that's probably just me...

Seems that maybe DGUX does it wrong?

-MS