john@renoir.Berkeley.EDU (John Coker) (05/21/87)
I have a large program which uses longjmp to ``get back to a safe place'' when anything bad happens (user error, interrrupt, etc.). Code which works fine on a Vax causes the stack to get completely trashed on a Sun, resulting a segmentation violation on the first statement to be executed after the return to setjmp (the stack is left with only the function which called setjmp, none of its parents, and presumably a trashed stack). Yes, I read the man page and have removed all register variables from the routine which calls setjmp. However, I use register variables in functions called between the setjmp and longjmp, some of which may be ``active'' when longjmp is called. I can't imagine that this is the problem. I'm at a loss as to how to debug this (I've tried a one-file example of longjmp/setjmp, and it works fine). Has anyone had a similar problem or heard of something strange in the use of Sun longjmp? Please respond to me personally. John Coker john@renoir.Berkeley.EDU