When the signal is delivered, the signal handler is executed on the stack of the process.
If SA_ONSTACK is used in sigaction(), then a different stack is used.
What is the use of using different stack? Any use case example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One use of an alternate stack is to try and handle
SIGSEGVproperly.If your process just received a
SIGSEGVbecause it exceeded its stack limit, you can’t run the signal handler on the process’s stack – it’s full already. Having an alternate stack allows you to (carefully) run some more or less graceful shutdown in that case.