Heads up - big changes in signal handling

Christopher Faylor cgf@redhat.com
Wed Sep 10 03:30:00 GMT 2003


Red Hat has a potential contract that would finance some changes in
signal handling to finally get signals working with threads.  In
anticipation of this, I've made a huge change to the way signals are
handled.  I've reverted to an idea that I had in 1998 and rewrote the
signalling mechanism for signals to use pipes.  Obviously pipes can
transfer a lot more state than semaphores and preliminary results seem
to indicate that things are working well.  I've removed huge amounts of
complication from sigproc.cc.

My litmus test of "can I login via ssh to zsh?" works fine but I haven't
yet run the test suite on my changes.  I'll probably do that tomorrow
and check things in shortly thereafter if everything works well.

This change went remarkably smoothly -- too smoothly in fact.  My
changes worked after only a few tweaks.  That's probably a sign that I
missed something important.

One consequence of this change is that multiple invocations of the same
signal are no longer queued.  I played with this concept for a long time
when I first rewrote the signal handler.  Different implementations
turned it on and off.  For a time, I had an ifdef for it in sigproc.cc.
This is just the latest in the toggle of whether cygwin records each
invocation if you send SIGTERM to a process 27 times and the process has
blocked SIGTERM.  Hopefully, there isn't any code out there which relies
on the old cygwin behavior.  It wouldn't be difficult to reimplement the
old behavior but I'd rather not do so.  The current behavior (and the
old behavior) were within the implementation-specific realm in SUSv3.

Anyway, just a heads up.  Things may be unstable for a while until
I get all of the kinks worked out.

Someday soon, I have to check in my device handing rewrite, too.  Oddly
enough my managed mode stuff causes a few problems with that, so I can't
just check it in as is.  That plus the fact that I can't currently use
my branch to login via ssh, is sort of a show stopper.

FYI,
cgf



More information about the Cygwin-developers mailing list