From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: SIGCHLD in vfork child context Date: Fri, 19 May 2017 12:19:39 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1495164000 20713 195.159.176.226 (19 May 2017 03:20:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 May 2017 03:20:00 +0000 (UTC) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 19 05:19:56 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 1dBYSK-00058B-6L for ged-emacs-devel@m.gmane.org; Fri, 19 May 2017 05:19:56 +0200 Original-Received: from localhost ([::1]:56342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBYSJ-0006Nk-L8 for ged-emacs-devel@m.gmane.org; Thu, 18 May 2017 23:19:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBYSD-0006NR-R1 for emacs-devel@gnu.org; Thu, 18 May 2017 23:19:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBYSA-00051t-NW for emacs-devel@gnu.org; Thu, 18 May 2017 23:19:49 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:58911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBYSA-00050N-75 for emacs-devel@gnu.org; Thu, 18 May 2017 23:19:46 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 26700F094B for ; Fri, 19 May 2017 12:19:39 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 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:214971 Archived-At: >>>>> On Tue, 16 May 2017 01:58:37 -0700, Paul Eggert said: >> It seems that calling waitpid from the SIGCHLD handler results in >> ECHILD in the vfork child context > Why is the vfork child process getting a SIGCHLD signal? That process doesn't > have any children. Is the macOS kernel simply buggy? If so, I suggest adding a > short explanation of the situation to this comment: >> + /* Call the SIGCHLD handler in case we have received SIGCHLD in >> + the vfork child context. The signal mask is restored by >> + unblock_child_signal below. */ I'll make the comment for the first hunk more explicit about the situation: #ifdef DARWIN_OS /* On Darwin, SIGCHLD for status change of a child process can be delivered to the vfork child context. It will confuse the SIGCHLD handler because waitpid results in ECHILD there. */ signal (SIGCHLD, SIG_DFL); #endif >> + (*action.sa_handler) (SIGCHLD); > No need for the * and the first set of parens. I.e., this is OK: > action.sa_handler (SIGCHLD); > Otherwise, looks OK; thanks. Thanks for the comments. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp