On 02/01, Stas Sergeev wrote:There is quite a difference.
01.02.2016 22:29, Oleg Nesterov ÐÐÑÐÑ:Ah, ia32... So this is even more confusing.
AFAIK without SA_SIGINFO you get sigreturn instead ofHmm. how this connects to SA_SIGINFO ?sigaltstack({ DISABLE | FORCE}, &old_ss);Yes, that's what I do in my app already.
swapcontext();
sigaltstack(&old_ss, NULL);
rt_sigreturn();
and if you are going to return from sighandler you do not even need the 2nd
sigaltstack(), you can rely on sigreturn.
But its only there when SA_SIGINFO is used.
rt_sigreturn, which doesn't seem to do restore_altstack().
Or am I wrong?
Hmm:
/* Set up the stack frame */
if (is_ia32_frame()) {
if (ksig->ka.sa.sa_flags & SA_SIGINFO)
return ia32_setup_rt_frame(usig, ksig, cset, regs);
else
return ia32_setup_frame(usig, ksig, cset, regs);
Yes, but I still can't understand your "silently ignored". At least how doesBefore we return, the signals are usually blocked.Still can't understand. The 2nd sigaltstack() is no longer EPERMed becauseAllowing the modifications that were previously EPERMedWhat's at the end? Do we want a surprise for the userCan't understand.... do you mean "set up new_sas" will be ignored because
that he's new_sas got ignored?
rt_sigreturn() does restore_sigaltstack() ? I see no problem here...
but will now be silently ignored, may be seen as a problem.
But if it isn't - fine, lets code that.
application used SS_FORCED before that and disabled altstack.
And it is not ignored, it actually changes alt stack. Until we return from
handler.
So whatever is after return is most important.
this differ from the case when a non-SA_ONSTACK signal handler does
sigaltstack() and then rt_sigreturn() restores the old stack.