unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>, emacs-devel@gnu.org
Subject: Re: SIGCHLD in vfork child context
Date: Sun, 21 May 2017 01:49:19 -0700	[thread overview]
Message-ID: <5f8efbc5-1cb9-5e2c-65c6-f09cf0bdfd89@cs.ucla.edu> (raw)
In-Reply-To: <wla8683pla.wl%mituharu@math.s.chiba-u.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

YAMAMOTO Mitsuharu wrote:
> I think resetting the SIGCHLD handler in the vfork child on Darwin is
> still a good thing to do even with the change you installed, if the
> SIGCHLD handler call in such a context is unexpected (and does not
> happen on the other platforms).

Although I'm still not entirely sure we've diagnosed the problem correctly, it 
shouldn't hurt to run that code on macOS, so I installed the attached.

[-- Attachment #2: 0001-Work-around-macOS-bug-with-vforked-child.patch --]
[-- Type: text/x-patch, Size: 928 bytes --]

From 611880e11714007a1b5303eedb89bdfacb0a574a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 21 May 2017 01:46:44 -0700
Subject: [PATCH] Work around macOS bug with vforked child

* src/callproc.c (call_process) [DARWIN_OS]:
Include workaround for apparent macOS bug.
---
 src/callproc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/callproc.c b/src/callproc.c
index 7c85eed..4cec02b 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -631,6 +631,14 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
 
   if (pid == 0)
     {
+#ifdef DARWIN_OS
+      /* Work around a macOS bug, where SIGCHLD is apparently
+	 delivered to a vforked child instead of to its parent.  See:
+	 http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html
+      */
+      signal (SIGCHLD, SIG_DFL);
+#endif
+
       unblock_child_signal (&oldset);
 
 #ifdef DARWIN_OS
-- 
2.7.4


  reply	other threads:[~2017-05-21  8:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13  5:41 SIGCHLD in vfork child context YAMAMOTO Mitsuharu
2017-05-15  1:04 ` YAMAMOTO Mitsuharu
2017-05-16  8:58 ` Paul Eggert
2017-05-16  9:19   ` Andreas Schwab
2017-05-16  9:50     ` Paul Eggert
2017-05-16 10:22       ` Andreas Schwab
2017-05-19  7:16         ` Paul Eggert
2017-05-19  3:19   ` YAMAMOTO Mitsuharu
2017-05-19  7:18     ` Paul Eggert
2017-05-20  8:22       ` YAMAMOTO Mitsuharu
2017-05-21  8:49         ` Paul Eggert [this message]
2017-05-21  8:53           ` mituharu
2017-05-21  9:01             ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f8efbc5-1cb9-5e2c-65c6-f09cf0bdfd89@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).