From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: SIGCHLD in vfork child context Date: Sun, 21 May 2017 01:49:19 -0700 Organization: UCLA Computer Science Department Message-ID: <5f8efbc5-1cb9-5e2c-65c6-f09cf0bdfd89@cs.ucla.edu> References: <0b475f31-f024-9a09-6f5f-22e42d091bd2@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E48F3F3F7D798C0E21308985" X-Trace: blaine.gmane.org 1495356610 21448 195.159.176.226 (21 May 2017 08:50:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 May 2017 08:50:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 To: YAMAMOTO Mitsuharu , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 21 10:50:06 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCMYv-0005PD-Qa for ged-emacs-devel@m.gmane.org; Sun, 21 May 2017 10:50:06 +0200 Original-Received: from localhost ([::1]:36801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCMYz-0001Lo-S6 for ged-emacs-devel@m.gmane.org; Sun, 21 May 2017 04:50:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCMYH-0001Lh-Qx for emacs-devel@gnu.org; Sun, 21 May 2017 04:49:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCMYE-00073a-O8 for emacs-devel@gnu.org; Sun, 21 May 2017 04:49:25 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54338) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCMYE-00071x-Gm for emacs-devel@gnu.org; Sun, 21 May 2017 04:49:22 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0D95C160051; Sun, 21 May 2017 01:49:21 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nu6mM9sHZ-8i; Sun, 21 May 2017 01:49:19 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A983B16007F; Sun, 21 May 2017 01:49:19 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lwEGm7xWyJKo; Sun, 21 May 2017 01:49:19 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8849E160051; Sun, 21 May 2017 01:49:19 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215040 Archived-At: This is a multi-part message in MIME format. --------------E48F3F3F7D798C0E21308985 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------E48F3F3F7D798C0E21308985 Content-Type: text/x-patch; name="0001-Work-around-macOS-bug-with-vforked-child.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Work-around-macOS-bug-with-vforked-child.patch" >From 611880e11714007a1b5303eedb89bdfacb0a574a Mon Sep 17 00:00:00 2001 From: Paul Eggert 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 --------------E48F3F3F7D798C0E21308985--