[PATCH suggestion] exceptions.cc, interrupt_setup ()



Hello, there! :)

Someone might remember that the main reason for delaying the
Midnight Commander release for Cygwin so long was that there was a
problem with the subshell support. I was thinking that this was a
problem in Cygwin, but I wasn't able to track it down... until today.

This issue went to the mc-devel list and stalled there for some time
until recently Pavel Roskin offered his help to debug the problem.
Based on his finding
(http://mail.gnome.org/archives/mc-devel/2002-August/msg00062.html) I
was able to track down the problem in the cygwin signal handling code.

The problem is triggered by the sigdelayed0() code which always
restores the signal mask (exceptions.cc, line 1237) using
sigsave.oldmask. The real problem is that the sigsave.oldmask field
is never initialised when preparing to execute a signal handler.
So imagine that someone set sigsave.oldmask to some value (sigsuspend() in this case),
then you will always get this value as the signal mask after a signal handler is called.

I suggest the following very simple patch. Since I may have not
understand all the specifics of the signal handling mechanism I offer
it for discussion. Just for the record - this patch solves that
outstanding problem with MC.

Thanks!

Pavel Tsekov

Attachment: exceptions.cc.diff
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]