This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
sigaltstack setting and RT signal handlers
- From: Paul Mackerras <paulus at samba dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Sat, 8 Feb 2003 11:48:48 +1100
- Subject: sigaltstack setting and RT signal handlers
Currently the linux kernel saves the sigaltstack setting in the signal
frame when it invokes a "real-time" signal handler (one installed with
the SA_SIGINFO flag set) and restores the setting when the signal
handler returns.
The result of this is that if you call sigaltstack() inside a RT
signal handler, the effect of that call only persists until the signal
handler returns.
I am coming to the view that this is bogus. I don't see any reason
why the sigaltstack() setting should form part of the process context
that is preserved across a signal handler invocation. There doesn't
seem to be anything that I could see in POSIX that says that it should
be. And having your sigaltstack setting undone on exiting a RT signal
handler could be somewhat surprising.
Is there any reason why glibc needs this behaviour? Or do people
think that it is actually a bug for the kernel to change the
sigaltstack setting without an explicit sigaltstack system call?
Paul.