On Tue, Jan 25, 2011 at 11:11 PM, Leon Timmermans <fawaka@gmail.com> wrote: > ribasushi discovered an issue in this patch. It breaks unsafe signal > handling. The summary: > > When an exception is thrown in a signal handler that results in a call > to longjmp. Calling longjmp from a signal handler is undefined per C > standard and POSIX (and has a CERT recommendation against it, > SIG32-C). On Linux, and probably other systems too, one of the > consequences of jumping out of a a signal handler is that the signal > mask won't get reset as it should. The previous code compensated for > that by always unblocking the signal. Since we can't retroactively > forbid exceptions in unsafe signal handlers, we should solve this > differently. We can either > > a) Reinstate the old unblocking code for unsafe signals > b) Don't block the current signal in the first place, by using the > SA_NODEFER flag in sigaction. Patch doing option a attached. Not extensively tested though. LeonThread Previous | Thread Next