From c7041908b82205af2f812f9de782003d975f53da Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 23 Jun 2013 11:18:47 -0700 Subject: Try to avoid malloc SEGVs on Cygwin. * callproc.c, process.h (block_child_signal, unblock_child_signal): Now extern. * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify. * process.c (catch_child_signal): Block SIGCHLD while futzing with the SIGCHLD handler, since the code is not atomic and (due to glib) signals may be arriving now. * sysdep.c (init_signals): Do not catch child signals here; 'main' now does that later, at a safer time. Fixes: debbugs:14569 --- src/process.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index 3e31dede4c2..6df1bf7eff7 100644 --- a/src/process.c +++ b/src/process.c @@ -7084,11 +7084,13 @@ catch_child_signal (void) #endif emacs_sigaction_init (&action, deliver_child_signal); + block_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; + unblock_child_signal (); } -- cgit v1.2.1