This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]