From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: SIGCHLD in vfork child context Date: Tue, 16 May 2017 11:19:43 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1494926394 31476 195.159.176.226 (16 May 2017 09:19:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 May 2017 09:19:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: YAMAMOTO Mitsuharu , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 16 11:19:50 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 1dAYdx-00083D-Ul for ged-emacs-devel@m.gmane.org; Tue, 16 May 2017 11:19:50 +0200 Original-Received: from localhost ([::1]:40619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAYe3-0004Ga-BY for ged-emacs-devel@m.gmane.org; Tue, 16 May 2017 05:19:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAYdx-0004GK-Bv for emacs-devel@gnu.org; Tue, 16 May 2017 05:19:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAYdu-000062-7h for emacs-devel@gnu.org; Tue, 16 May 2017 05:19:49 -0400 Original-Received: from mx2.suse.de ([195.135.220.15]:38724 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAYdu-00005o-0k for emacs-devel@gnu.org; Tue, 16 May 2017 05:19:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D1356AAC5; Tue, 16 May 2017 09:19:44 +0000 (UTC) X-Yow: I'm reporting for duty as a modern person. I want to do the Latin Hustle now! In-Reply-To: (Paul Eggert's message of "Tue, 16 May 2017 01:58:37 -0700") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 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:214876 Archived-At: On Mai 16 2017, Paul Eggert wrote: > YAMAMOTO Mitsuharu wrote: >> 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? In any case, the sigchld handler should handle that case gracefully. Spurious SIGCHLD should not cause emacs to abort. > 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. */ > > If not, then I don't understand the situation.... > >> + (*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. IMHO this is barking up the wrong tree. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."