[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14569: 24.3.50; bootstrap fails on Cygwin
From: |
Paul Eggert |
Subject: |
bug#14569: 24.3.50; bootstrap fails on Cygwin |
Date: |
Fri, 14 Jun 2013 10:45:47 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
Cygwin developers, I'm worried about a Cygwin bug where
pthread_kill may not send a signal to the correct thread.
This bug may be causing Emacs to crash. The Cygwin bug is
discussed in this thread:
http://cygwin.com/ml/cygwin/2012-05/msg00472.html
Emacs uses pthread_kill to redirect
SIGCHLD to the main thread; if this is sent to a random
thread instead, that could explain the random crashes.
My question is: does this bug still exist with Cygwin,
and if so is it likely to get fixed soon?
More details about the Emacs bug can be found here:
http://bugs.gnu.org/14569
Briefly, Emacs is crashing randomly on Cygwin ever since it started
doing this:
/* Tickle glib's child-handling code. Ask glib to wait for Emacs itself;
this should always fail, but is enough to initialize glib's
private SIGCHLD handler. */
g_source_unref (g_child_watch_source_new (getpid ()));
After this newly-inserted code, Emacs finds out what the
child signal handler was:
/* Now, find out what glib's signal handler was, and store it
into lib_child_handler. */
struct sigaction action, old_action;
emacs_sigaction_init (&action, deliver_child_signal);
sigaction (SIGCHLD, &action, &old_action);
eassert (! (old_action.sa_flags & SA_SIGINFO));
if (old_action.sa_handler != SIG_DFL && old_action.sa_handler != SIG_IGN
&& old_action.sa_handler != deliver_child_signal)
lib_child_handler = old_action.sa_handler;
Emacs's SIGCHILD handler, deliver_child_signal, arranges the
signal handling to occur in the main thread (to avoid races
within Emacs), like this:
int old_errno = errno;
bool on_main_thread = true;
if (! pthread_equal (pthread_self (), main_thread))
{
sigset_t blocked;
sigemptyset (&blocked);
sigaddset (&blocked, sig);
pthread_sigmask (SIG_BLOCK, &blocked, 0);
pthread_kill (main_thread, sig);
on_main_thread = false;
}
if (on_main_thread)
handle_child_signal (sig);
errno = old_errno;
And handle_child_signal, which runs in the main thread, does
a bunch of Emacsish things and then invokes lib_child_handler (sig),
which is glib's SIGCHLD handler.
All this works just fine on Fedora and other platforms; but it
doesn't work on Cygwin.
- bug#14569: 24.3.50; bootstrap fails on Cygwin, (continued)
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Eli Zaretskii, 2013/06/11
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Ken Brown, 2013/06/11
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/11
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/11
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/12
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Paul Eggert, 2013/06/12
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Angelo Graziosi, 2013/06/12
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/13
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Paul Eggert, 2013/06/13
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/14
- bug#14569: 24.3.50; bootstrap fails on Cygwin,
Paul Eggert <=
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Christopher Faylor, 2013/06/14
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Ken Brown, 2013/06/14
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Eli Zaretskii, 2013/06/15
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/15
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Eli Zaretskii, 2013/06/15
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/15
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Ken Brown, 2013/06/16
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Jan Djärv, 2013/06/17
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Eli Zaretskii, 2013/06/17
- bug#14569: 24.3.50; bootstrap fails on Cygwin, Ken Brown, 2013/06/17