How to go to the main stack

I am using an alternate signal handling stack for a program in C over linux. When a stack overflow occurs, my signal is delivered to my secondary signal stack, not on the main stack.

So in this situation I want to reset the main stack .... how can I?

0


source to share


1 answer


remember the top stack address in the main (& some local variable in that stack frame) and dump from the exception address to that. Be aware that there are some portability issues (e.g. the hp-pa-risc stack grows upwards). If the failure was not due to access to a protected area under an overflowed stack, you need to look at the exception information for sp that was valid before the signal. The exception information is passed as an argument to the signal handler. Again, this is likely to be very complex and specific (varies across all nodes).



welcomes

+1


source







All Articles