From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#14297: 24.3.50; emacs subprocesses don't exit on "exit" Date: Mon, 13 May 2013 09:58:17 -0700 Message-ID: <51911BA9.7080703@cs.ucla.edu> References: <87d2te3l09.fsf@gmail.com> <51906E5F.3070905@cs.ucla.edu> <8338tqan14.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1368464322 320 80.91.229.3 (13 May 2013 16:58:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 May 2013 16:58:42 +0000 (UTC) Cc: spinuvit@gmail.com, 14297@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 13 18:58:40 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ubw5A-0007jc-8K for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2013 18:58:40 +0200 Original-Received: from localhost ([::1]:33680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubw59-0002JE-OM for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2013 12:58:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubw55-0002Ir-MC for bug-gnu-emacs@gnu.org; Mon, 13 May 2013 12:58:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ubw54-0001Ku-PG for bug-gnu-emacs@gnu.org; Mon, 13 May 2013 12:58:35 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubw54-0001Kq-Ma for bug-gnu-emacs@gnu.org; Mon, 13 May 2013 12:58:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Ubw5W-0002SO-3t for bug-gnu-emacs@gnu.org; Mon, 13 May 2013 12:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 May 2013 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 14297-submit@debbugs.gnu.org id=B14297.13684643339430 (code B ref 14297); Mon, 13 May 2013 16:59:02 +0000 Original-Received: (at 14297) by debbugs.gnu.org; 13 May 2013 16:58:53 +0000 Original-Received: from localhost ([127.0.0.1]:38854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ubw5M-0002S2-V2 for submit@debbugs.gnu.org; Mon, 13 May 2013 12:58:53 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:60841) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ubw5K-0002Ru-LF for 14297@debbugs.gnu.org; Mon, 13 May 2013 12:58:52 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id D997B39E810E; Mon, 13 May 2013 09:58:21 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UjKG2QTERJjG; Mon, 13 May 2013 09:58:21 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6BC9A39E8109; Mon, 13 May 2013 09:58:21 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 In-Reply-To: <8338tqan14.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74208 Archived-At: On 05/13/13 08:59, Eli Zaretskii wrote: > So I'm not sure this is the same problem. I agree. I brought up the issue because the question arose as to how (process-live-p proc) is connected to the window toolkit. It's conceivable, for example, that a buggy Gtk plugin is doing a waitpid (-1, ...), which would mess up Emacs greatly (and would also mess up other applications, the symptoms observed here). Perhaps we should apply something like the following patch, to help detect these situations better? === modified file 'src/sysdep.c' --- src/sysdep.c 2013-03-24 12:59:45 +0000 +++ src/sysdep.c 2013-05-13 16:56:59 +0000 @@ -315,7 +315,8 @@ get_child_status (pid_t child, int *stat void wait_for_termination (pid_t child, int *status, bool interruptible) { - get_child_status (child, status, 0, interruptible); + if (get_child_status (child, status, 0, interruptible) < 0) + emacs_abort (); } /* Report whether the subprocess with process id CHILD has changed status. @@ -330,7 +331,10 @@ wait_for_termination (pid_t child, int * pid_t child_status_changed (pid_t child, int *status, int options) { - return get_child_status (child, status, WNOHANG | options, 0); + pid_t p = get_child_status (child, status, WNOHANG | options, 0); + if (p < 0) + emacs_abort (); + return p; } /*