GNU bug report logs - #14474
24.3.50; Zombie subprocesses (again)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: michael_heerdegen@HIDDEN; dated Sat, 25 May 2013 23:41:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 5 Jun 2013 17:24:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 05 13:24:11 2013
Received: from localhost ([127.0.0.1]:52772 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UkHRR-0006fI-He
	for submit <at> debbugs.gnu.org; Wed, 05 Jun 2013 13:24:10 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:36312)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UkHRO-0006ei-K3
	for 14474 <at> debbugs.gnu.org; Wed, 05 Jun 2013 13:24:08 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id AEB95A60002;
	Wed,  5 Jun 2013 10:21:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 unwD9GYo5d3O; Wed,  5 Jun 2013 10:21:54 -0700 (PDT)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DA84CA60001;
	Wed,  5 Jun 2013 10:21:53 -0700 (PDT)
Message-ID: <51AF73AA.3050609@HIDDEN>
Date: Wed, 05 Jun 2013 10:21:46 -0700
From: Paul Eggert <eggert@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130514 Thunderbird/17.0.6
MIME-Version: 1.0
To: Colin Walters <walters@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
	<51A9487B.5080805@HIDDEN> <1370049737.19234.4.camel@localhost>
	<51A9915E.9010406@HIDDEN>
	<jwv4ndhhpgq.fsf-monnier+emacs@HIDDEN>
	<1370275779.19234.17.camel@localhost>
	<51AD9533.4080709@HIDDEN>
In-Reply-To: <51AD9533.4080709@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -4.7 (----)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>,
	Stefan Monnier <monnier@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.7 (----)

I found another problem with trying to have Emacs use glib's child watcher.
glib's signal handling code uses SA_RESTART and SA_NOCLDSTOP.
Both flags are non-starters for Emacs.  SA_NOCLDSTOP, I suppose,
could be conditionalized based on the discussion in Gnome bug
reports 701538 and 562501.  But SA_RESTART is more of a worry.
An interactive Emacs doesn't want SA_RESTART, because Emacs wants
long-running syscalls to be interrupted after a signal, not
restarted.

I thought of a way to work around this problem: have Emacs catch
SIGCHLD using its own flags, and call glib's SIGCHLD handler as part
of Emacs's SIGCHLD handler.  So I installed the patch quoted at the
end of this message into the Emacs trunk as bzr 112859.  If you've
had D-bus problems please try this new approach.

This raises three more questions for glib, though.  First,
why does glib use SA_RESTART?  If it's to avoid having application
syscalls fail with errno==EINTR, then we're OK.  But if it's to
avoid having glib's internal syscalls fail with errno==EINTR, then
we have a problem, as that can happen with the following patch
(and it can also happen with vanilla Emacs 24.3).

Second, should there be a more robust way for Emacs to invoke
glib's SIGCHLD handler.  The code below is a bit of a hack:
it uses g_source_unref (g_child_watch_source_new (0)) to
create and free a dummy SIGCHLD source, the only reason being
to trick glib into installing its SIGCHLD handler.  It also assumes
that glib does not use SA_SIGINFO.  This all seems fairly fragile.

Third, if a glib memory allocation fails, what does Emacs do?
Emacs tries hard not to exit when there's a memory allocation failure,
but I worry that glib will simply call 'exit' if malloc fails, which
is not good.

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2013-06-05 12:17:02 +0000
+++ src/ChangeLog	2013-06-05 17:04:13 +0000
@@ -1,3 +1,17 @@
+2013-06-05  Paul Eggert  <eggert@HIDDEN>
+
+	Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
+	* process.c (dummy_handler): New function.
+	(lib_child_handler): New static var.
+	(handle_child_signal): Invoke it.
+	(catch_child_signal): If a library has set up a signal handler,
+	save it into lib_child_handler.
+	(init_process_emacs): If using glib and not on Windows, tickle glib's
+	child-handling code so that it initializes its private SIGCHLD handler.
+	* syssignal.h (SA_SIGINFO): Default to 0.
+	* xterm.c (x_term_init): Remove D-bus hack that I installed on May
+	31; it should no longer be needed now.
+
 2013-06-05  Michael Albinus  <michael.albinus@HIDDEN>
 
 	* emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.

=== modified file 'src/process.c'
--- src/process.c	2013-06-03 18:47:35 +0000
+++ src/process.c	2013-06-05 17:04:13 +0000
@@ -6100,6 +6100,12 @@
    might inadvertently reap a GTK-created process that happened to
    have the same process ID.  */
 
+/* LIB_CHILD_HANDLER is a SIGCHLD handler that Emacs calls while doing
+   its own SIGCHLD handling.  On POSIXish systems, glib needs this to
+   keep track of its own children.  The default handler does nothing.  */
+static void dummy_handler (int sig) {}
+static signal_handler_t volatile lib_child_handler = dummy_handler;
+
 /* Handle a SIGCHLD signal by looking for known child processes of
    Emacs whose status have changed.  For each one found, record its
    new status.
@@ -6184,6 +6190,8 @@
 	    }
 	}
     }
+
+  lib_child_handler (sig);
 }
 
 static void
@@ -7035,9 +7043,13 @@
 void
 catch_child_signal (void)
 {
-  struct sigaction action;
+  struct sigaction action, old_action;
   emacs_sigaction_init (&action, deliver_child_signal);
-  sigaction (SIGCHLD, &action, 0);
+  sigaction (SIGCHLD, &action, &old_action);
+  eassert (! (old_action.sa_flags & SA_SIGINFO));
+  if (old_action.sa_handler != SIG_DFL && old_action.sa_handler != SIG_IGN
+      && old_action.sa_handler != deliver_child_signal)
+    lib_child_handler = old_action.sa_handler;
 }
 
 
@@ -7055,6 +7067,11 @@
   if (! noninteractive || initialized)
 #endif
     {
+#if defined HAVE_GLIB && !defined WINDOWSNT
+      /* Tickle glib's child-handling code so that it initializes its
+	 private SIGCHLD handler.  */
+      g_source_unref (g_child_watch_source_new (0));
+#endif
       catch_child_signal ();
     }
 

=== modified file 'src/syssignal.h'
--- src/syssignal.h	2013-01-02 16:13:04 +0000
+++ src/syssignal.h	2013-06-05 17:04:13 +0000
@@ -50,6 +50,10 @@
 # define NSIG NSIG_MINIMUM
 #endif
 
+#ifndef SA_SIGINFO
+# define SA_SIGINFO 0
+#endif
+
 #ifndef emacs_raise
 # define emacs_raise(sig) raise (sig)
 #endif

=== modified file 'src/xterm.c'
--- src/xterm.c	2013-05-31 01:41:52 +0000
+++ src/xterm.c	2013-06-05 17:04:13 +0000
@@ -9897,13 +9897,6 @@
 
         XSetLocaleModifiers ("");
 
-	/* If D-Bus is not already configured, inhibit D-Bus autolaunch,
-	   as autolaunch can mess up Emacs's SIGCHLD handler.
-	   FIXME: Rewrite subprocess handlers to use glib's child watchers.
-	   See Bug#14474.  */
-	if (! egetenv ("DBUS_SESSION_BUS_ADDRESS"))
-	  xputenv ("DBUS_SESSION_BUS_ADDRESS=unix:path=/dev/null");
-
         /* Emacs can only handle core input events, so make sure
            Gtk doesn't use Xinput or Xinput2 extensions.  */
 	xputenv ("GDK_CORE_DEVICE_EVENTS=1");






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 4 Jun 2013 17:14:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 04 13:14:55 2013
Received: from localhost ([127.0.0.1]:50771 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ujuox-0006lk-78
	for submit <at> debbugs.gnu.org; Tue, 04 Jun 2013 13:14:55 -0400
Received: from mout.web.de ([212.227.15.14]:64090)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1Ujuou-0006lM-LR
	for 14474 <at> debbugs.gnu.org; Tue, 04 Jun 2013 13:14:54 -0400
Received: from drachen.dragon ([89.204.153.211]) by smtp.web.de (mrweb101)
	with ESMTPSA (Nemesis) id 0MHowb-1Ugu710x8n-003k2s;
	Tue, 04 Jun 2013 19:12:47 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost> <51A399B0.7070203@HIDDEN>
	<51A4E1A6.1000602@HIDDEN>
Date: Tue, 04 Jun 2013 19:12:41 +0200
In-Reply-To: <51A4E1A6.1000602@HIDDEN> (Paul Eggert's message of "Tue, 28
	May 2013 09:56:06 -0700")
Message-ID: <878v2pby0m.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:J5RdMaMF2LsaRHZyw5c8wCDU4N15p/vZztu/CYHpnDv
	ARPVOBA1U5RnYrXYt0UGuO0/498sYblErIQ2LVtEozJqOWUP04
	5/qoYpijieoWoH4reHztmCTu59zDiXOjlwsqeU/oa7aRnBrzye
	hmR8E6fkkFz/bQ0jllWjHd2FJve/G+pD3JHSxlnvGwWlRmTRVR
	y47rnZmVLn80AVrkeTQ+5zHcE6uBzGF3RB1Px6V0t8=
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.7 (-)

Hi Paul,

> In <http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00628.html>
> something like the following milder workaround was suggested instead.
> Michael, does this patch work around the bug for your test case?

Have already installed it to trunk?  The issue is fixed for me after
upgrading my emacs-snapshot to

(emacs-version) ==>

GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)
of 2013-06-03 on dex, modified by Debian


Thanks,

Michael.

>
> === modified file 'src/xterm.c'
> --- src/xterm.c	2013-05-09 14:49:56 +0000
> +++ src/xterm.c	2013-05-28 16:34:44 +0000
> @@ -9897,6 +9897,13 @@ x_term_init (Lisp_Object display_name, c
>  
>          XSetLocaleModifiers ("");
>  
> +	/* If D-Bus is not already configured, inhibit D-Bus autolaunch,
> +	   as autolaunch can mess up Emacs's SIGCHLD handler.
> +	   FIXME: Rewrite subprocess handlers to use glib's child watchers.
> +	   See Bug#14474.  */
> +	if (! egetenv ("DBUS_SESSION_BUS_ADDRESS"))
> +	  xputenv ("DBUS_SESSION_BUS_ADDRESS=");
> +
>          /* Emacs can only handle core input events, so make sure
>             Gtk doesn't use Xinput or Xinput2 extensions.  */
>  	xputenv ("GDK_CORE_DEVICE_EVENTS=1");




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 4 Jun 2013 07:22:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 04 03:22:24 2013
Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UjlZY-00036S-Fq
	for submit <at> debbugs.gnu.org; Tue, 04 Jun 2013 03:22:24 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:33470)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UjlZW-00035t-FW
	for 14474 <at> debbugs.gnu.org; Tue, 04 Jun 2013 03:22:23 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 3A5D539E8106;
	Tue,  4 Jun 2013 00:20:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 6ewMBp4b-5SL; Tue,  4 Jun 2013 00:20:19 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B266A39E8105;
	Tue,  4 Jun 2013 00:20:19 -0700 (PDT)
Message-ID: <51AD9533.4080709@HIDDEN>
Date: Tue, 04 Jun 2013 00:20:19 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Colin Walters <walters@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
	<51A9487B.5080805@HIDDEN> <1370049737.19234.4.camel@localhost>
	<51A9915E.9010406@HIDDEN>
	<jwv4ndhhpgq.fsf-monnier+emacs@HIDDEN>
	<1370275779.19234.17.camel@localhost>
In-Reply-To: <1370275779.19234.17.camel@localhost>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -4.7 (----)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>,
	Stefan Monnier <monnier@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.7 (----)

On 06/03/2013 09:09 AM, Colin Walters wrote:
> Are there any other blocking issues for Emacs using the GLib mainloop?
> If that's the only one I can probably get around to doing a patch this
> week.

Don't know of any.  But I haven't implemented it yet.

If it's the only problem, perhaps the Emacs code should be written
to run on older glibs, where it'll ignore child-process stops and continues.
If this turns out to be a real problem we can disable it (i.e., use the
current godawful workaround) on older glibs.  But anyway, the idea is
to prevent this from being a blocking issue for Emacs.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 3 Jun 2013 16:11:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 03 12:11:55 2013
Received: from localhost ([127.0.0.1]:49209 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UjXMN-0008VX-9X
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2013 12:11:54 -0400
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57837)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <walters@HIDDEN>) id 1UjXMK-0008VM-Q1
	for 14474 <at> debbugs.gnu.org; Mon, 03 Jun 2013 12:11:50 -0400
Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 5617720CC3;
	Mon,  3 Jun 2013 12:09:42 -0400 (EDT)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute6.internal (MEProxy); Mon, 03 Jun 2013 12:09:43 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=subject:from:to:cc:in-reply-to:references
	:content-type:date:message-id:mime-version
	:content-transfer-encoding; s=smtpout; bh=HJwX0lisRDlV0sXAAdSL5J
	JLJtg=; b=dSHVFlrVWBkMm1JYw5e1Sua/1C3cs6lAlTfMtnbvnMZFKHqgq/Lmtd
	YhdCvSoS0PueA9PTsPl6TNRHIoRgO3A6In95SRf/kv3s2nS4LlWJQ1TlrySiP/eA
	dJFCUEaJ9d/G6chKtJZdlPB+JmMxHx4isc0AH5eXmOK3/kqAYshSU=
X-Sasl-enc: TZRlxBC4NxXoSCGmDQnjzCqYikjWieBfwjukAwy04C9z 1370275780
Received: from [192.168.1.3] (unknown [66.31.18.51])
	by mail.messagingengine.com (Postfix) with ESMTPA id 5F1F4C80159;
	Mon,  3 Jun 2013 12:09:40 -0400 (EDT)
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
From: Colin Walters <walters@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwv4ndhhpgq.fsf-monnier+emacs@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost> <51A9487B.5080805@HIDDEN>
	<1370049737.19234.4.camel@localhost> <51A9915E.9010406@HIDDEN>
	<jwv4ndhhpgq.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Date: Mon, 03 Jun 2013 12:09:39 -0400
Message-ID: <1370275779.19234.17.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.32.3 (2.32.3-1.el6) 
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.2 (-)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Paul Eggert <eggert@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

On Sat, 2013-06-01 at 10:33 -0400, Stefan Monnier wrote:
> > Emacs has a function process-status that returns
> > a process's status.
> 
> Not only that, but the process-sentinel is called when the status
> changes.  This said, I don't know if there are any process-sentinels out
> there that need to be told when a process is stopped or "continued".

Right; I kind of doubt it.  Regardless though, I filed:

https://bugzilla.gnome.org/show_bug.cgi?id=701538

Are there any other blocking issues for Emacs using the GLib mainloop?
If that's the only one I can probably get around to doing a patch this
week.

I suspect though you could simply not report stopped status, and not
break any real world programs.  The only thing I can think of is a
multiprocess application which sends SIGSTOP to children (but why would
they do that?).






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 1 Jun 2013 14:35:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 01 10:35:23 2013
Received: from localhost ([127.0.0.1]:46233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uimtu-0000Mv-JU
	for submit <at> debbugs.gnu.org; Sat, 01 Jun 2013 10:35:23 -0400
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43274)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1Uimts-0000Ma-M3
	for 14474 <at> debbugs.gnu.org; Sat, 01 Jun 2013 10:35:21 -0400
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
	[132.204.27.242])
	by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r51EXTQ8032520;
	Sat, 1 Jun 2013 10:33:29 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
	id 54AB8AE1E3; Sat,  1 Jun 2013 10:33:29 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
Message-ID: <jwv4ndhhpgq.fsf-monnier+emacs@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost> <51A9487B.5080805@HIDDEN>
	<1370049737.19234.4.camel@localhost> <51A9915E.9010406@HIDDEN>
Date: Sat, 01 Jun 2013 10:33:29 -0400
In-Reply-To: <51A9915E.9010406@HIDDEN> (Paul Eggert's message of "Fri, 31
	May 2013 23:14:54 -0700")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.2
X-NAI-Spam-Rules: 2 Rules triggered
	GEN_SPAM_FEATRE=0.2, RV4596=0
X-NAI-Spam-Version: 2.3.0.9362 : core <4596> : streams <972257> : uri <1436001>
X-Spam-Score: -4.6 (----)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 14474 <at> debbugs.gnu.org,
	Michael Albinus <michael.albinus@HIDDEN>,
	Colin Walters <walters@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

> Emacs has a function process-status that returns
> a process's status.

Not only that, but the process-sentinel is called when the status
changes.  This said, I don't know if there are any process-sentinels out
there that need to be told when a process is stopped or "continued".


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 1 Jun 2013 06:16:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 01 02:16:44 2013
Received: from localhost ([127.0.0.1]:45678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uif7L-0000rJ-CB
	for submit <at> debbugs.gnu.org; Sat, 01 Jun 2013 02:16:44 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:33371)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1Uif7J-0000qj-4n
	for 14474 <at> debbugs.gnu.org; Sat, 01 Jun 2013 02:16:42 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id C88DA39E8100;
	Fri, 31 May 2013 23:14:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 zi56TDreRQIr; Fri, 31 May 2013 23:14:55 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6051839E8008;
	Fri, 31 May 2013 23:14:55 -0700 (PDT)
Message-ID: <51A9915E.9010406@HIDDEN>
Date: Fri, 31 May 2013 23:14:54 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Colin Walters <walters@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
	<51A9487B.5080805@HIDDEN> <1370049737.19234.4.camel@localhost>
In-Reply-To: <1370049737.19234.4.camel@localhost>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -5.3 (-----)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

On 05/31/2013 06:22 PM, Colin Walters wrote:
> Why, out of curiosity?

Emacs has a function process-status that returns
a process's status.  Possible statuses include

run  -- for a process that is running.
stop -- for a process stopped but continuable.
exit -- for a process that has exited.
signal -- for a process that has got a fatal signal.

To implement this, Emacs keeps track, for each of its
child processes, what that process's status is.
Emacs updates the information that it records about
a child process whenever it's notified about
a child process status change.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 1 Jun 2013 01:24:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 21:24:02 2013
Received: from localhost ([127.0.0.1]:45452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiaY5-00023v-Jr
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 21:24:01 -0400
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56978)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <walters@HIDDEN>) id 1UiaY4-00023g-7b
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 21:24:00 -0400
Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 8EDAB20C92;
	Fri, 31 May 2013 21:22:18 -0400 (EDT)
Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161])
	by compute2.internal (MEProxy); Fri, 31 May 2013 21:22:19 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=subject:from:to:cc:in-reply-to:references
	:content-type:date:message-id:mime-version
	:content-transfer-encoding; s=smtpout; bh=U6ci85PaQqiWo4dvpn4UME
	uCYac=; b=gCGDaTlcA7qlOqvEuh87PcM33wBLLdbo/PdhZowk3VJhu8Z8zaKeG5
	F9eAoQR6H0PRR9f27YRB8Le4F5z5nGxosbdhrfSRuEbnR9xW7ZlSix2c4pxEyNrV
	6heVf7ixLkIfLSuGp/B+ZalDeA0ADRHv2AvDqs/fWGNxxaUCY8+mk=
X-Sasl-enc: kFuBfGZ3kkSmvVtHNv9IR+ulMkK+LR29W4mum2vpOpem 1370049738
Received: from [192.168.1.3] (unknown [66.31.18.51])
	by mail.messagingengine.com (Postfix) with ESMTPA id 5D67C2000D8;
	Fri, 31 May 2013 21:22:18 -0400 (EDT)
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
From: Colin Walters <walters@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <51A9487B.5080805@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN>  <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>  <51A9487B.5080805@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Date: Fri, 31 May 2013 21:22:17 -0400
Message-ID: <1370049737.19234.4.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.32.3 (2.32.3-1.el6) 
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

On Fri, 2013-05-31 at 18:03 -0700, Paul Eggert wrote:
> On 05/27/2013 05:46 AM, Colin Walters wrote:
> >> One possibility is to see if we can get Emacs to use
> >> > glib's child watcher.
> > That'd be best obviously.
> 
> I looked into this a bit, and found a problem.
> Emacs wants to be notified about child processes
> that are stopped, 

Why, out of curiosity?

>    g_child_watch_source_new_full (pid, WUNTRACED | WCONTINUED)

We could add that to glib-unix.h probably, yeah.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 1 Jun 2013 01:05:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 21:05:48 2013
Received: from localhost ([127.0.0.1]:45443 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiaGR-0001D6-Oh
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 21:05:48 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53507)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UiaGP-0001CW-0Y
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 21:05:46 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id AC13139E8100;
	Fri, 31 May 2013 18:04:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 eNXopiT0ULdW; Fri, 31 May 2013 18:04:00 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 40CCE39E8008;
	Fri, 31 May 2013 18:04:00 -0700 (PDT)
Message-ID: <51A9487B.5080805@HIDDEN>
Date: Fri, 31 May 2013 18:03:55 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Colin Walters <walters@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
In-Reply-To: <1369658780.23869.57.camel@localhost>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	Michael Albinus <michael.albinus@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

On 05/27/2013 05:46 AM, Colin Walters wrote:
>> One possibility is to see if we can get Emacs to use
>> > glib's child watcher.
> That'd be best obviously.

I looked into this a bit, and found a problem.
Emacs wants to be notified about child processes
that are stopped, so it invokes waitpid with the
WUNTRACED option, but glib never uses WUNTRACED
when invoking waitpid.  If Emacs used glib to watch for
child processes, Emacs will not be informed about
a child process changing state because it has
stopped.  (Similarly for WCONTINUED and processes
that have been continued.)

Perhaps glib needs a new function, which lets the
caller specify additional options to be given to
waitpid?  Something like this, say:

   g_child_watch_source_new_full (pid, WUNTRACED | WCONTINUED)

Then, g_child_watch_source_new (pid) would be equivalent to
g_child_watch_source_new_full (pid, 0).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 31 May 2013 22:10:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 18:10:32 2013
Received: from localhost ([127.0.0.1]:45217 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiXWp-0002nK-HY
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 18:10:32 -0400
Received: from mailout.melmac.se ([62.20.26.67]:59485)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <jan.h.d@HIDDEN>) id 1UiXWl-0002n0-RP
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 18:10:30 -0400
Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80])
	by mailout.melmac.se (Postfix) with ESMTP id CDB0492F6
	for <14474 <at> debbugs.gnu.org>; Sat,  1 Jun 2013 00:08:42 +0200 (CEST)
Received: (qmail 10769 invoked by uid 89); 31 May 2013 22:08:42 -0000
Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain)
	(boel.djarv@HIDDEN@46.59.42.57)
	by mail01.melmac.se with ESMTPA; 31 May 2013 22:08:42 -0000
Received: from [172.20.199.240] (unknown [172.20.199.240])
	by coolsville.localdomain (Postfix) with ESMTPSA id 510B11A1B8A;
	Fri, 31 May 2013 22:08:42 +0000 (UTC)
References: <87zjxxn6th.fsf@HIDDEN> <87hajqpjn1.fsf@HIDDEN>
	<jwvtxnnfptz.fsf-monnier+emacs@HIDDEN> <8738t7pewc.fsf@HIDDEN>
	<51A4C2E9.8040000@HIDDEN> <87vc63nlje.fsf@HIDDEN>
	<51A4FFAD.20202@HIDDEN> <87obbuc0dy.fsf@HIDDEN>
	<51A515B8.4040405@HIDDEN> <87bo7ub9go.fsf@HIDDEN>
	<51A80019.90900@HIDDEN> <874ndjat9z.fsf@HIDDEN>
	<51A8F904.8000808@HIDDEN>
Mime-Version: 1.0 (1.0)
In-Reply-To: <51A8F904.8000808@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-Id: <50B5EE99-7C36-4B6F-978C-BAFF8D6A5173@HIDDEN>
X-Mailer: iPhone Mail (10B350)
From: =?utf-8?Q?Jan_Dj=C3=A4rv?= <jan.h.d@HIDDEN>
Subject: Re: bug#14474: Using glib's g_file_monitor_file and
	g_file_monitor_directory
Date: Sat, 1 Jun 2013 00:08:40 +0200
To: Paul Eggert <eggert@HIDDEN>
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
	has
	identified this incoming email as possible spam. The original message
	has been attached to this so you can view it (if it isn't spam) or
	label similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview: Hello. 31 maj 2013 kl. 21:24 skrev Paul Eggert
	<eggert@HIDDEN>: > On 05/31/13 11:39,
	Michael Albinus wrote: > >> You've put the lines inside
	#ifdef USE_GTK. However,
	glib could be >> linked to Emacs without using gtk.
	We might need another check,
	like >> #ifdef USE_GLIB. This would be useful
	in other places, too. > > That might make sense in the long run,
	if Emacs is built that way. > But as I understand it,
	currently Emacs links to glib only when > using Gtk,
	so the workaround is OK under the current framework. > [...] 
	Content analysis details:   (1.5 points, 10.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)
	0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
	[score: 0.4096]
	0.0 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars
X-Debbugs-Envelope-To: 14474
Cc: Michael Albinus <michael.albinus@HIDDEN>,
	"14474 <at> debbugs.gnu.org" <14474 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.2 (-)

Hello.

31 maj 2013 kl. 21:24 skrev Paul Eggert <eggert@HIDDEN>:

> On 05/31/13 11:39, Michael Albinus wrote:
>=20
>> You've put the lines inside #ifdef USE_GTK. However, glib could be
>> linked to Emacs without using gtk. We might need another check, like
>> #ifdef USE_GLIB. This would be useful in other places, too.
>=20
> That might make sense in the long run, if Emacs is built that way.
> But as I understand it, currently Emacs links to glib only when
> using Gtk, so the workaround is OK under the current framework.
>=20

This is false. Emacs links with glib if one of GConf, Gsettings or rsvg is l=
inked in. They are independent of Gtk.

      Jan D.=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 31 May 2013 21:01:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 17:01:51 2013
Received: from localhost ([127.0.0.1]:45128 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiWSL-0000Jc-Qr
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 17:01:50 -0400
Received: from mout.gmx.net ([212.227.15.19]:60319)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael.albinus@HIDDEN>) id 1UiWSH-0000JI-9u
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 17:01:47 -0400
Received: from mailout-de.gmx.net ([10.1.76.24]) by mrigmx.server.lan
	(mrigmx001) with ESMTP (Nemesis) id 0MJHgy-1UgrTE0C3W-002lGs for
	<14474 <at> debbugs.gnu.org>; Fri, 31 May 2013 23:00:02 +0200
Received: (qmail invoked by alias); 31 May 2013 21:00:01 -0000
Received: from p5DCA33AE.dip0.t-ipconnect.de (EHLO detlef.gmx.de)
	[93.202.51.174]
	by mail.gmx.net (mp024) with SMTP; 31 May 2013 23:00:01 +0200
X-Authenticated: #3708877
X-Provags-ID: V01U2FsdGVkX19YscIUJHhYhQnQh2WN3R4srPBjcKN+daowZKBPb2
	6ZWT1nPHim702m
From: Michael Albinus <michael.albinus@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: Using glib's g_file_monitor_file and g_file_monitor_directory
References: <87zjxxn6th.fsf@HIDDEN> <87hajqpjn1.fsf@HIDDEN>
	<jwvtxnnfptz.fsf-monnier+emacs@HIDDEN> <8738t7pewc.fsf@HIDDEN>
	<51A4C2E9.8040000@HIDDEN> <87vc63nlje.fsf@HIDDEN>
	<51A4FFAD.20202@HIDDEN> <87obbuc0dy.fsf@HIDDEN>
	<51A515B8.4040405@HIDDEN> <87bo7ub9go.fsf@HIDDEN>
	<51A80019.90900@HIDDEN> <874ndjat9z.fsf@HIDDEN>
	<51A8F904.8000808@HIDDEN>
Date: Fri, 31 May 2013 22:59:59 +0200
In-Reply-To: <51A8F904.8000808@HIDDEN> (Paul Eggert's message of "Fri, 31
	May 2013 12:24:52 -0700")
Message-ID: <87li6uamr4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

Paul Eggert <eggert@HIDDEN> writes:

>> You've put the lines inside #ifdef USE_GTK. However, glib could be
>> linked to Emacs without using gtk. We might need another check, like
>> #ifdef USE_GLIB. This would be useful in other places, too.
>
> That might make sense in the long run, if Emacs is built that way.
> But as I understand it, currently Emacs links to glib only when
> using Gtk, so the workaround is OK under the current framework.

The g_file_monitor patch I've shown uses glib. No gtk. And the same is
true for gconf and gsettings, IIUC.

> I do see the problem that you mention.  I think a better fix, though,
> is to redo Emacs to use the glib child watcher code -- that will fix
> the problem that you mention, along with the problem for Emacs itself.

Yep, this might be better.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 31 May 2013 19:26:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 15:26:45 2013
Received: from localhost ([127.0.0.1]:45027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiUyL-000592-5o
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 15:26:45 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:38197)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UiUyI-00058R-1O
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 15:26:44 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 72A2CA60001;
	Fri, 31 May 2013 12:24:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 VXw2CW+U49zl; Fri, 31 May 2013 12:24:58 -0700 (PDT)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DD20F39E8008;
	Fri, 31 May 2013 12:24:57 -0700 (PDT)
Message-ID: <51A8F904.8000808@HIDDEN>
Date: Fri, 31 May 2013 12:24:52 -0700
From: Paul Eggert <eggert@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130311 Thunderbird/17.0.4
MIME-Version: 1.0
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: Using glib's g_file_monitor_file and g_file_monitor_directory
References: <87zjxxn6th.fsf@HIDDEN> <87hajqpjn1.fsf@HIDDEN>
	<jwvtxnnfptz.fsf-monnier+emacs@HIDDEN> <8738t7pewc.fsf@HIDDEN>
	<51A4C2E9.8040000@HIDDEN> <87vc63nlje.fsf@HIDDEN>
	<51A4FFAD.20202@HIDDEN> <87obbuc0dy.fsf@HIDDEN>
	<51A515B8.4040405@HIDDEN> <87bo7ub9go.fsf@HIDDEN>
	<51A80019.90900@HIDDEN> <874ndjat9z.fsf@HIDDEN>
In-Reply-To: <874ndjat9z.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

On 05/31/13 11:39, Michael Albinus wrote:

> You've put the lines inside #ifdef USE_GTK. However, glib could be
> linked to Emacs without using gtk. We might need another check, like
> #ifdef USE_GLIB. This would be useful in other places, too.

That might make sense in the long run, if Emacs is built that way.
But as I understand it, currently Emacs links to glib only when
using Gtk, so the workaround is OK under the current framework.

> Furthermore, I'd wrap these lines with #ifdef HAVE_DBUS. If Emacs is
> compiled without D-Bus support, external processes could still use
> D-Bus via autolaunch. You suppress this possibility by overwriting
> $DBUS_SESSION_BUS_ADDRESS.

Can't the Emacs process autolaunch D-bus subprocesses even when it
HAVE_DBUS is not defined?  That is, some other toolkit that Emacs links to,
could autolaunch D-Bus.  So it wouldn't be safe to wrap the lines
with #ifdef HAVE_DBUS.

I do see the problem that you mention.  I think a better fix, though,
is to redo Emacs to use the glib child watcher code -- that will fix
the problem that you mention, along with the problem for Emacs itself.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 31 May 2013 18:40:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 14:40:56 2013
Received: from localhost ([127.0.0.1]:44977 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiUFz-0003O0-4W
	for submit <at> debbugs.gnu.org; Fri, 31 May 2013 14:40:56 -0400
Received: from mout.gmx.net ([212.227.17.20]:61472)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael.albinus@HIDDEN>) id 1UiUFt-0003Ng-SL
	for 14474 <at> debbugs.gnu.org; Fri, 31 May 2013 14:40:52 -0400
Received: from mailout-de.gmx.net ([10.1.76.33]) by mrigmx.server.lan
	(mrigmx002) with ESMTP (Nemesis) id 0M0NrX-1UPqRr48Nx-00uYp6 for
	<14474 <at> debbugs.gnu.org>; Fri, 31 May 2013 20:39:07 +0200
Received: (qmail invoked by alias); 31 May 2013 18:39:06 -0000
Received: from p5DCA33AE.dip0.t-ipconnect.de (EHLO detlef.gmx.de)
	[93.202.51.174]
	by mail.gmx.net (mp033) with SMTP; 31 May 2013 20:39:06 +0200
X-Authenticated: #3708877
X-Provags-ID: V01U2FsdGVkX1+USEFMMfqUzF+X2PdEGQiDYSCdsH4Zax7TxtPxDR
	+f5wB1vdihHhvh
From: Michael Albinus <michael.albinus@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: Using glib's g_file_monitor_file and g_file_monitor_directory
References: <87zjxxn6th.fsf@HIDDEN> <87hajqpjn1.fsf@HIDDEN>
	<jwvtxnnfptz.fsf-monnier+emacs@HIDDEN> <8738t7pewc.fsf@HIDDEN>
	<51A4C2E9.8040000@HIDDEN> <87vc63nlje.fsf@HIDDEN>
	<51A4FFAD.20202@HIDDEN> <87obbuc0dy.fsf@HIDDEN>
	<51A515B8.4040405@HIDDEN> <87bo7ub9go.fsf@HIDDEN>
	<51A80019.90900@HIDDEN>
Date: Fri, 31 May 2013 20:39:04 +0200
In-Reply-To: <51A80019.90900@HIDDEN> (Paul Eggert's message of "Thu, 30
	May 2013 18:42:49 -0700")
Message-ID: <874ndjat9z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Y-GMX-Trusted: 0
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

Paul Eggert <eggert@HIDDEN> writes:

Hi Paul,

> On 05/28/2013 11:12 PM, Michael Albinus wrote:
>> DBUS_SESSION_BUS_ADDRESS="unix:path=/dev/null" seems to be reliable.
>
> OK, thanks, I committed a patch along those lines to the trunk
> (bzr 112795); please give it a try.

You've put the lines inside #ifdef USE_GTK. However, glib could be
linked to Emacs without using gtk. We might need another check, like
#ifdef USE_GLIB. This would be useful in other places, too.

Furthermore, I'd wrap these lines with #ifdef HAVE_DBUS. If Emacs is
compiled without D-Bus support, external processes could still use
D-Bus via autolaunch. You suppress this possibility by overwriting
$DBUS_SESSION_BUS_ADDRESS.

Best regards, Michael.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 31 May 2013 01:44:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 30 21:44:32 2013
Received: from localhost ([127.0.0.1]:43437 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UiEON-0006ia-P9
	for submit <at> debbugs.gnu.org; Thu, 30 May 2013 21:44:32 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:52830)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UiEOK-0006iE-O0
	for 14474 <at> debbugs.gnu.org; Thu, 30 May 2013 21:44:29 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 4A2B4A60002;
	Thu, 30 May 2013 18:42:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 47vc+qTZySY2; Thu, 30 May 2013 18:42:50 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id EFCB2A60001;
	Thu, 30 May 2013 18:42:49 -0700 (PDT)
Message-ID: <51A80019.90900@HIDDEN>
Date: Thu, 30 May 2013 18:42:49 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: Using glib's g_file_monitor_file and g_file_monitor_directory
References: <87zjxxn6th.fsf@HIDDEN> <87hajqpjn1.fsf@HIDDEN>
	<jwvtxnnfptz.fsf-monnier+emacs@HIDDEN> <8738t7pewc.fsf@HIDDEN>
	<51A4C2E9.8040000@HIDDEN> <87vc63nlje.fsf@HIDDEN>
	<51A4FFAD.20202@HIDDEN> <87obbuc0dy.fsf@HIDDEN>
	<51A515B8.4040405@HIDDEN> <87bo7ub9go.fsf@HIDDEN>
In-Reply-To: <87bo7ub9go.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

On 05/28/2013 11:12 PM, Michael Albinus wrote:
> DBUS_SESSION_BUS_ADDRESS="unix:path=/dev/null" seems to be reliable.

OK, thanks, I committed a patch along those lines to the trunk
(bzr 112795); please give it a try.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 28 May 2013 20:44:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 16:43:59 2013
Received: from localhost ([127.0.0.1]:38012 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UhQkQ-0006Sy-S9
	for submit <at> debbugs.gnu.org; Tue, 28 May 2013 16:43:59 -0400
Received: from mout.web.de ([212.227.15.3]:63892)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UhQkP-0006Sl-1k
	for 14474 <at> debbugs.gnu.org; Tue, 28 May 2013 16:43:57 -0400
Received: from drachen.dragon ([89.204.139.215]) by smtp.web.de (mrweb003)
	with ESMTPSA (Nemesis) id 0MFL64-1UbwXQ1gAe-00Enf6;
	Tue, 28 May 2013 22:42:21 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost> <51A399B0.7070203@HIDDEN>
	<51A4E1A6.1000602@HIDDEN>
Date: Tue, 28 May 2013 22:42:14 +0200
In-Reply-To: <51A4E1A6.1000602@HIDDEN> (Paul Eggert's message of "Tue, 28
	May 2013 09:56:06 -0700")
Message-ID: <87ip22zvix.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:WYBZ/nVznJ86b1j+aZbOnFPuz2zLhs6S6dBnA2FVOmu
	p+jo0XsyAxKGIEXBAmfw35I7bkh8FizC/D6iunEwFjkvLSUBAa
	53CTLzjQfPCBKybtM2CMqt5NYpPxwv+IMksOY79gK+yn4oCLAR
	qNkCr16U7EdBLNjL4p5Qg7bQauWqKh6BqfQkZeOmfEidh+8iUX
	iPCwqBSOL41ZRvP3oYHDP4NjVoS2tImlZpm6NX/m/Y=
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.0 (---)

Paul Eggert <eggert@HIDDEN> writes:

> In <http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00628.html>
> something like the following milder workaround was suggested instead.
> Michael, does this patch work around the bug for your test case?

Thanks for that, but I currently use a precompiled package for my OS
(emacs-snapshot), so I can neither debug C nor test patches.

It would be great if someone else that can reproduce this bug could try
that.  If not, I'll try to build Emacs myself in the next days, hoping
that the problem manifests there, too.


Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 28 May 2013 17:06:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 13:06:19 2013
Received: from localhost ([127.0.0.1]:37766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UhNLn-0007WZ-70
	for submit <at> debbugs.gnu.org; Tue, 28 May 2013 13:06:19 -0400
Received: from mailout.melmac.se ([62.20.26.67]:53926)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <jan.h.d@HIDDEN>) id 1UhNLj-0007W8-EA
	for 14474 <at> debbugs.gnu.org; Tue, 28 May 2013 13:06:17 -0400
Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80])
	by mailout.melmac.se (Postfix) with ESMTP id 86910919B
	for <14474 <at> debbugs.gnu.org>; Tue, 28 May 2013 19:04:49 +0200 (CEST)
Received: (qmail 26664 invoked by uid 89); 28 May 2013 17:04:49 -0000
Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain)
	(boel.djarv@HIDDEN@46.59.42.57)
	by mail01.melmac.se with ESMTPA; 28 May 2013 17:04:49 -0000
Received: from [172.20.199.13] (unknown [172.20.199.13])
	by coolsville.localdomain (Postfix) with ESMTPSA id E975C1A05C6;
	Tue, 28 May 2013 17:04:48 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
From: =?iso-8859-1?Q?Jan_Dj=E4rv?= <jan.h.d@HIDDEN>
In-Reply-To: <51A399B0.7070203@HIDDEN>
Date: Tue, 28 May 2013 19:04:59 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <439C96AC-545D-424F-87BD-37815592C7AB@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
	<51A399B0.7070203@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
X-Mailer: Apple Mail (2.1503)
X-Spam-Score: -1.2 (-)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 14474 <at> debbugs.gnu.org,
	Colin Walters <walters@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.2 (-)

Hello.

27 maj 2013 kl. 19:36 skrev Paul Eggert <eggert@HIDDEN>:

> [The context is
> http://bugs.gnu.org/14474
> ]
>=20
> On 05/27/2013 05:46 AM, Colin Walters wrote:
>=20
>> Basically it's going to be very hard over time to avoid codepaths
>> in the GTK+ stack that don't call g_spawn_*() indirectly, thus
>> installing a SIGCHLD handler
>=20
> Thanks.  In that case, shouldn't the glib documentation be
> changed to warn application developers not to install a SIGCHLD
> handler as well?  Currently it warns them only to not call
> waitpid(-1, ...).
>=20
> Are application developers allowed to temporarily mask SIGCHLD?
> Emacs does that a lot.
>=20
>>> One possibility is to see if we can get Emacs to use
>>>> glib's child watcher.
>> That'd be best obviously.
>=20

> I suspect so too, but it requires more expertise in
> glib than I have (which is, basically, nothing).
> If I understand things correctly, if Emacs is using
> Gtk it should
>=20

Actually GLib is linked in whenever one of GSettings, GConf, Gtk or rsvg =
is used.
I see rsvg only is not handeled in xgselect.c, an oversight.


> * never call sigaction (SIGCHLD, ...) or signal (SIGCHLD, ...)
>   or waitpid (-1, ...).
>   E.g., remove the current call to sigaction (SIGCHLD, ...),
>   in src/process.c's init_process_emacs.
>=20
> * Whenever Emacs creates a child process, use the
>   following pattern:
>=20
>       block SIGCHLD;
>       pid =3D vfork ();
>       if (pid > 0)
>         {
>           record pid in Emacs's process table, as location 'loc';
>           record in *loc that glib is watching this pid;
>           g_child_watch_add (pid, watcher, loc);
>         }
>       unblock SIGCHLD;
>=20
>  * never call waitpid (pid, ...) if PID is recorded
>    in Emacs's process table as something that glib is
>    watching.
>=20
>  * Add a glue function ("watcher", above) that does
>    something like this:
>=20
>      void watcher (GPid pid, gint status, gpointer loc) {
> 	block SIGCHLD
>        record that PID exited with status STATUS, by modifying *LOC,
> 	  sort of like's what currently done in handle_child_signal;
>        if (input_available_clear_time)
> 	  *input_available_clear_time =3D make_emacs_time (0, 0);
>        unblock SIGCHLD
>     }
>=20
> But this sounds incomplete.  No doubt there's something
> about the main loop, or setting up the watchers, that I don't
> know about.  E.g., how does one remove the watcher once it
> has fired and told us that the process has exited?
>=20

Keep track of the return value from g_child_watch_add and pass it to =
g_source_remove.
I think g_source_remove can be called in the callback function.

We kind of use GLibs main loop in xgselect.c, so child watches should be =
called from there.
As GLib:s main loop is an "all or nothing" approach, we could also move =
the filedescriptor and timeout handling  there.  Then xgselect.c could =
more or less go away.  But there is no real gain to do that, xgselect =
works well enough.

	Jan D.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 28 May 2013 16:57:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 12:57:38 2013
Received: from localhost ([127.0.0.1]:37754 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UhNDN-0007GE-7x
	for submit <at> debbugs.gnu.org; Tue, 28 May 2013 12:57:38 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:42024)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UhNDI-0007Ft-H7
	for 14474 <at> debbugs.gnu.org; Tue, 28 May 2013 12:57:34 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id D69A7A60005;
	Tue, 28 May 2013 09:56:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 VlqTjuwkECpV; Tue, 28 May 2013 09:56:06 -0700 (PDT)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B1B0A39E8106;
	Tue, 28 May 2013 09:56:06 -0700 (PDT)
Message-ID: <51A4E1A6.1000602@HIDDEN>
Date: Tue, 28 May 2013 09:56:06 -0700
From: Paul Eggert <eggert@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130311 Thunderbird/17.0.4
MIME-Version: 1.0
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
	<51A399B0.7070203@HIDDEN>
In-Reply-To: <51A399B0.7070203@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -5.3 (-----)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

In <http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00628.html>
something like the following milder workaround was suggested instead.
Michael, does this patch work around the bug for your test case?

=== modified file 'src/xterm.c'
--- src/xterm.c	2013-05-09 14:49:56 +0000
+++ src/xterm.c	2013-05-28 16:34:44 +0000
@@ -9897,6 +9897,13 @@ x_term_init (Lisp_Object display_name, c
 
         XSetLocaleModifiers ("");
 
+	/* If D-Bus is not already configured, inhibit D-Bus autolaunch,
+	   as autolaunch can mess up Emacs's SIGCHLD handler.
+	   FIXME: Rewrite subprocess handlers to use glib's child watchers.
+	   See Bug#14474.  */
+	if (! egetenv ("DBUS_SESSION_BUS_ADDRESS"))
+	  xputenv ("DBUS_SESSION_BUS_ADDRESS=");
+
         /* Emacs can only handle core input events, so make sure
            Gtk doesn't use Xinput or Xinput2 extensions.  */
 	xputenv ("GDK_CORE_DEVICE_EVENTS=1");




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 27 May 2013 18:26:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 14:26:33 2013
Received: from localhost ([127.0.0.1]:36756 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uh27r-0003eZ-98
	for submit <at> debbugs.gnu.org; Mon, 27 May 2013 14:26:32 -0400
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51482)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <walters@HIDDEN>) id 1Ugwpq-00085g-L9
	for 14474 <at> debbugs.gnu.org; Mon, 27 May 2013 08:47:35 -0400
Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 93CA021774;
	Mon, 27 May 2013 08:46:21 -0400 (EDT)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
	by compute5.internal (MEProxy); Mon, 27 May 2013 08:46:21 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=subject:from:to:cc:in-reply-to:references
	:content-type:date:message-id:mime-version
	:content-transfer-encoding; s=smtpout; bh=MbI2afWm1RtTBuMY3Y2IBI
	S9iCQ=; b=AMCrpiZ08Bw6nkHvndvXIOU/SeLUFiXY9qYal3yZDCUxQXvpEHWa9T
	yNEUDRAMlVKFIz+8/e80KFI4fO/qvxILEIsOrzrxuUt3m3XHlHoK8PdlZuN8hDAw
	ud2Bb1zPhgI49zKpfqfS3JoPmwT5dBtSMRg2clxVeEC1MmgpYdCCg=
X-Sasl-enc: If+G4EIr6rfg9A9jfglAe5TsNdSxA4p6cY0U17ASKUiw 1369658781
Received: from [192.168.1.3] (unknown [66.31.18.51])
	by mail.messagingengine.com (Postfix) with ESMTPA id 2A909C8000A;
	Mon, 27 May 2013 08:46:21 -0400 (EDT)
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
From: Colin Walters <walters@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <51A2B88F.1090404@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN>  <51A2B88F.1090404@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Date: Mon, 27 May 2013 08:46:20 -0400
Message-ID: <1369658780.23869.57.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 (2.28.3-30.el6) 
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 14474
X-Mailman-Approved-At: Mon, 27 May 2013 14:26:28 -0400
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

On Sun, 2013-05-26 at 18:36 -0700, Paul Eggert wrote:

> but that's already the case in the Emacs trunk.
> Is there another limitation that we
> didn't know about, a limitation that says Emacs can't
> have signal handlers either?

Basically it's going to be very hard over time to avoid codepaths
in the GTK+ stack that don't call g_spawn_*() indirectly, thus
installing a SIGCHLD handler, particuarly due to the pluggable nature of
Gio.

> I'll CC: this to Colin Walters since he seemed to have
> a good handle on the situation from the glib point of view; see
> <https://bugzilla.gnome.org/show_bug.cgi?id=676167>.

Yeah, I don't think much has changed since then.

> One possibility is to see if we can get Emacs to use
> glib's child watcher.

That'd be best obviously.

>   But that's a bit of a delicate balance,
> since Emacs must work even when gtk is absent,

Bear in mind that GLib is usable without gtk.  Even if you don't
have an X connection, if the GLib mainloop is linked into the process,
I don't see a reason not to use it.

>  and it may need
> to hand off from its own watcher to glib's watcher, and processes
> shouldn't get lost during the handoff. 

Would Emacs really be spawning processes before initializing
the frontend?

> A simpler but hacky workaround is to not use the graphical interface if
> DBUS_SESSION_BUS_ADDRESS is unset.

I don't see a real problem with that as a temporary thing.

Anyways, if there is something I can do GLib side, let me know.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 27 May 2013 17:38:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 13:38:16 2013
Received: from localhost ([127.0.0.1]:36724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uh1NA-00028q-Ht
	for submit <at> debbugs.gnu.org; Mon, 27 May 2013 13:38:16 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:50697)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1Uh1N7-00028Y-4i
	for 14474 <at> debbugs.gnu.org; Mon, 27 May 2013 13:38:15 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 8236939E8116;
	Mon, 27 May 2013 10:36:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 8QWghTfsaAXj; Mon, 27 May 2013 10:36:52 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 69B8839E8113;
	Mon, 27 May 2013 10:36:52 -0700 (PDT)
Message-ID: <51A399B0.7070203@HIDDEN>
Date: Mon, 27 May 2013 10:36:48 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Colin Walters <walters@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN> <51A2B88F.1090404@HIDDEN>
	<1369658780.23869.57.camel@localhost>
In-Reply-To: <1369658780.23869.57.camel@localhost>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -5.3 (-----)
X-Debbugs-Envelope-To: 14474
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>,
	=?UTF-8?B?SmFuIERqw6Rydg==?= <jan.h.d@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

[The context is
http://bugs.gnu.org/14474
]

On 05/27/2013 05:46 AM, Colin Walters wrote:

> Basically it's going to be very hard over time to avoid codepaths
> in the GTK+ stack that don't call g_spawn_*() indirectly, thus
> installing a SIGCHLD handler

Thanks.  In that case, shouldn't the glib documentation be
changed to warn application developers not to install a SIGCHLD
handler as well?  Currently it warns them only to not call
waitpid(-1, ...).

Are application developers allowed to temporarily mask SIGCHLD?
Emacs does that a lot.

>> One possibility is to see if we can get Emacs to use
>> > glib's child watcher.
> That'd be best obviously.

I suspect so too, but it requires more expertise in
glib than I have (which is, basically, nothing).
If I understand things correctly, if Emacs is using
Gtk it should

 * never call sigaction (SIGCHLD, ...) or signal (SIGCHLD, ...)
   or waitpid (-1, ...).
   E.g., remove the current call to sigaction (SIGCHLD, ...),
   in src/process.c's init_process_emacs.
  =20
 * Whenever Emacs creates a child process, use the
   following pattern:

       block SIGCHLD;
       pid =3D vfork ();
       if (pid > 0)
         {
           record pid in Emacs's process table, as location 'loc';
           record in *loc that glib is watching this pid;
           g_child_watch_add (pid, watcher, loc);
         }
       unblock SIGCHLD;

  * never call waitpid (pid, ...) if PID is recorded
    in Emacs's process table as something that glib is
    watching.

  * Add a glue function ("watcher", above) that does
    something like this:

      void watcher (GPid pid, gint status, gpointer loc) {
	block SIGCHLD
        record that PID exited with status STATUS, by modifying *LOC,
	  sort of like's what currently done in handle_child_signal;
        if (input_available_clear_time)
	  *input_available_clear_time =3D make_emacs_time (0, 0);
        unblock SIGCHLD
     }

But this sounds incomplete.  No doubt there's something
about the main loop, or setting up the watchers, that I don't
know about.  E.g., how does one remove the watcher once it
has fired and told us that the process has exited?

I'll CC: this to Jan Dj=C3=A4rv, who knows about gtk, to
see if he can help.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 27 May 2013 01:37:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 26 21:37:37 2013
Received: from localhost ([127.0.0.1]:35910 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UgmNU-0005vk-CW
	for submit <at> debbugs.gnu.org; Sun, 26 May 2013 21:37:37 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:50311)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UgmNR-0005vS-Ly
	for 14474 <at> debbugs.gnu.org; Sun, 26 May 2013 21:37:35 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id EC7A1A60001;
	Sun, 26 May 2013 18:36:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 C+v8x9vfKYwn; Sun, 26 May 2013 18:36:16 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1B0D939E8113;
	Sun, 26 May 2013 18:36:16 -0700 (PDT)
Message-ID: <51A2B88F.1090404@HIDDEN>
Date: Sun, 26 May 2013 18:36:15 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
	<87fvx93818.fsf@HIDDEN>
In-Reply-To: <87fvx93818.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: 14474
Cc: Colin Walters <walters@HIDDEN>, 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

[The bug is that a bleeding-edge GTK Emacs loses child processes
when it's run via sudo; see <http://bugs.gnu.org/14474>.]

I think I may have spotted the problem.
Glib 2.36.2's glib/gmain.c has a function
'ensure_unix_signal_handler_installed_unlocked'
that is run in the dconf worker thread.
This function calls sigaction to replace Emacs's SIGCHLD handler
with glib's own handler g_unix_signal_handler.
Signal handlers are process-wide, so this replacement affects
all threads, including the main (Emacs) thread.

After that happens, Emacs never sees when its children
exit, since g_unix_signal_handler discards Emacs's
child-exit notices, and the Emacs function
deliver_child_signal is never invoked.

The comment for g_child_watch_source_new
says that Emacs isn't supposed to invoke waitpid (-1, ...),
but that's already the case in the Emacs trunk.
Is there another limitation that we
didn't know about, a limitation that says Emacs can't
have signal handlers either?

I'll CC: this to Colin Walters since he seemed to have
a good handle on the situation from the glib point of view; see
<https://bugzilla.gnome.org/show_bug.cgi?id=676167>.

One possibility is to see if we can get Emacs to use
glib's child watcher.  But that's a bit of a delicate balance,
since Emacs must work even when gtk is absent, and it may need
to hand off from its own watcher to glib's watcher, and processes
shouldn't get lost during the handoff.  I don't offhand know how
to do all that.

A simpler but hacky workaround is to not use the graphical interface if
DBUS_SESSION_BUS_ADDRESS is unset.  Something like this:

--- src/xterm.c	2013-05-09 14:49:56 +0000
+++ src/xterm.c	2013-05-27 01:32:44 +0000
@@ -9819,6 +9819,14 @@ x_display_ok (const char *display)
     int dpy_ok = 1;
     Display *dpy;
 
+#ifdef USE_GTK
+    if (! egetenv ("DBUS_SESSION_BUS_ADDRESS"))
+      {
+	fprintf (stderr, "DBUS_SESSION_BUS_ADDRESS unset, so Gtk is unsafe\n");
+	return 0;
+      }
+#endif
+
     dpy = XOpenDisplay (display);
     if (dpy)
       XCloseDisplay (dpy);






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 26 May 2013 18:35:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 26 14:35:29 2013
Received: from localhost ([127.0.0.1]:35700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ugfmy-00076G-Ul
	for submit <at> debbugs.gnu.org; Sun, 26 May 2013 14:35:29 -0400
Received: from mout.web.de ([212.227.15.3]:50537)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1Ugfmv-00075u-Mz
	for 14474 <at> debbugs.gnu.org; Sun, 26 May 2013 14:35:27 -0400
Received: from drachen.dragon ([89.204.130.236]) by smtp.web.de (mrweb002)
	with ESMTPSA (Nemesis) id 0LZeou-1U29QP1uFo-00lJNC;
	Sun, 26 May 2013 20:34:01 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN> <51A24870.8020909@HIDDEN>
Date: Sun, 26 May 2013 20:33:55 +0200
In-Reply-To: <51A24870.8020909@HIDDEN> (Paul Eggert's message of "Sun, 26
	May 2013 10:37:52 -0700")
Message-ID: <87fvx93818.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:4pflH+AxXhQ60WKHfIT6nS413T/rpZAOoGfBu3TP1iF
	RvGoxZXsDfdh1oSQ9HAMFGracEL66Nmx6tlnvYYOJ1BnpDStu9
	+ZgPhEyWPMGWttkFIqD5oB7jstcU0/xVfZRy6oZEho4D+5J+BH
	RxI0oevLLXYgXa/hYxnCFTXIGzeSmhjPYtgK1V8GE0lzz1IfSO
	KbFpCifx67pzUoGRR9zFX00JwxyI6NdLJ7LRIFmyxc=
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.0 (---)

Paul Eggert <eggert@HIDDEN> writes:

> And here is a session that worked.  The key difference is that
> I used su's '-E' option:
>
> $ env | grep DBUS
> DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bpx4rxPk7z,guid=6e491bf38a5b2b6fce17d0a251a221bf
> $ sudo -E sh
> # su exp
> $ env | grep DBUS
> DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bpx4rxPk7z,guid=6e491bf38a5b2b6fce17d0a251a221bf
> $ emacs
> ** (emacs:15441): WARNING **: Couldn't connect to accessibility bus:
> Failed to connect to socket /tmp/dbus-x2KgryK9C8: Connection refused

I see something similar - using the -E flag for sudo works as a
workaround.  However, I don't get this "Failed to connect to socket..."
warning.  Instead, I get

** (emacs:6638): WARNING **: The connection is closed


Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 26 May 2013 17:39:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 26 13:39:15 2013
Received: from localhost ([127.0.0.1]:35675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UgeuY-00058x-8k
	for submit <at> debbugs.gnu.org; Sun, 26 May 2013 13:39:15 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:37455)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UgeuV-00058h-TU
	for 14474 <at> debbugs.gnu.org; Sun, 26 May 2013 13:39:13 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id ACEC5A60001
	for <14474 <at> debbugs.gnu.org>; Sun, 26 May 2013 10:37:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
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 22OxERg-To2W for <14474 <at> debbugs.gnu.org>;
	Sun, 26 May 2013 10:37:56 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-108-49-126.lsanca.fios.verizon.net
	[71.108.49.126])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id E7DC539E8108
	for <14474 <at> debbugs.gnu.org>; Sun, 26 May 2013 10:37:56 -0700 (PDT)
Message-ID: <51A24870.8020909@HIDDEN>
Date: Sun, 26 May 2013 10:37:52 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version: 1.0
To: 14474 <at> debbugs.gnu.org
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: 14474
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

A workaround, for me at least, is to propagate the
DBUS_SESSION_BUS_ADDRESS environment variable into
the child process with a different userid.  

For example, here is a failing session, where I became the user 'exp'
and later observed the problem in a shell window:

$ env | grep DBUS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bpx4rxPk7z,guid=6e491bf38a5b2b6fce17d0a251a221bf
$ sudo sh
# su exp
$ env | grep DBUS
$ emacs
** (emacs:15115): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-x2KgryK9C8: Connection refused

And here is a session that worked.  The key difference is that
I used su's '-E' option:

$ env | grep DBUS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bpx4rxPk7z,guid=6e491bf38a5b2b6fce17d0a251a221bf
$ sudo -E sh
# su exp
$ env | grep DBUS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bpx4rxPk7z,guid=6e491bf38a5b2b6fce17d0a251a221bf
$ emacs
** (emacs:15441): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-x2KgryK9C8: Connection refused

In both cases, the dbus library complains to stderr that it can't connect
to /tmp/dbus-x2KgryK9C8 (I don't know where it's getting that name from).
When DBUS_SESSION_BUS_ADDRESS is unset, the dbus library arranges to run
the shell script /usr/bin/dbus-launch, which seems to cause the problem.
But when DBUS_SESSION_BUS_ADDRESS is set, the dbus library falls back
on its contents and doesn't invoke dbus-launch.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 26 May 2013 02:56:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 25 22:56:32 2013
Received: from localhost ([127.0.0.1]:35013 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UgR8J-0001dv-RU
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 22:56:32 -0400
Received: from mtaout22.012.net.il ([80.179.55.172]:33194)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eliz@HIDDEN>) id 1UgR8H-0001dg-OZ
	for 14474 <at> debbugs.gnu.org; Sat, 25 May 2013 22:56:30 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
	a-mtaout22.012.net.il (HyperSendmail v2007.08) id
	<0MND00M00X4ENE00@HIDDEN> for
	14474 <at> debbugs.gnu.org; Sun, 26 May 2013 05:55:18 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0MND00MX6XG69O90@HIDDEN>;
	Sun, 26 May 2013 05:55:18 +0300 (IDT)
Date: Sun, 26 May 2013 05:55:23 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
In-reply-to: <87ppwevddb.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: michael_heerdegen@HIDDEN
Message-id: <837gimqwkk.fsf@HIDDEN>
References: <87ppwevddb.fsf@HIDDEN>
X-Spam-Score: -1.2 (-)
X-Debbugs-Envelope-To: 14474
Cc: 14474 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.2 (-)

> From: Michael Heerdegen <michael_heerdegen@HIDDEN>
> Date: Sun, 26 May 2013 01:38:56 +0200
> 
> In such an Emacs, any child process seems to become a zombie after being
> finished.  E.g., after typing "exit" in a *terminal* running bash, there
> is still a running buffer process.  As a symptom, CPU is used
> continuously at 100% until I C-x C-c.

Can you attach a debugger and see where Emacs is looping?  etc/DEBUG
tells how to do that.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at 14474 <at> debbugs.gnu.org:


Received: (at 14474) by debbugs.gnu.org; 25 May 2013 23:50:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 25 19:50:26 2013
Received: from localhost ([127.0.0.1]:34860 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UgOED-0002Dq-Lt
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 19:50:26 -0400
Received: from mout.web.de ([212.227.15.3]:55935)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgOEB-0002DY-QG
	for 14474 <at> debbugs.gnu.org; Sat, 25 May 2013 19:50:24 -0400
Received: from drachen.dragon ([82.113.98.88]) by smtp.web.de (mrweb101) with
	ESMTPSA (Nemesis) id 0LxfOx-1UMyfL3vTf-0178em;
	Sun, 26 May 2013 01:49:13 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: 14474 <at> debbugs.gnu.org
Subject: Re: bug#14474: 24.3.50; Zombie subprocesses (again)
References: <87ppwevddb.fsf@HIDDEN>
Date: Sun, 26 May 2013 01:49:08 +0200
In-Reply-To: <87ppwevddb.fsf@HIDDEN> (Michael Heerdegen's message of "Sun, 26
	May 2013 01:38:56 +0200")
Message-ID: <87d2sevcwb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:McaPkGVqUV41Hadf8SQ/wdWv4ESLVYtAQy8l5Ge05RF
	lZsPP6NzsH4zOGy8DIP9FmKY44AwIH8zgZ2mBsuJJYbN+eQpzj
	mWrb03dAdFRkTylzz8gLv8RbbY91dgx3lYCkL6JSivP/dl293s
	HOQlNJQOnuNAbCfePEP17k3Ftl3JIN3EENhTGMV1gwxJpsfKcz
	rZKCY/unDGCFCxZc/NYczUN6T7lT4MMCQWdWODnm+0=
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 14474
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.0 (---)

Michael Heerdegen <michael_heerdegen@HIDDEN> writes:

> I'm experiencing the following:
>
> - I start Emacs in X as a different user (via gksu), or
>
> - I start Emacs from an X session that was started with startx
>
> In such an Emacs, any child process seems to become a zombie after being
> finished.  E.g., after typing "exit" in a *terminal* running bash, there
> is still a running buffer process.  As a symptom, CPU is used
> continuously at 100% until I C-x C-c.

BTW, this is what Paul Eggert answered in emacs-dev:

> I can reproduce the problem on Ubuntu 13.04.  Apparently when you
> start up a GTK Emacs session that can't talk to dbus (because it's
> su'ed), the dbus library starts up its own service, using dbus-launch.
> This messes up Emacs somehow (I don't know why).


Thanks,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2013 23:40:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 25 19:40:32 2013
Received: from localhost ([127.0.0.1]:34844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UgO4e-0001pt-Bx
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 19:40:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35852)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO4c-0001pW-Al
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 19:40:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO3U-0002KK-Fe
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 19:39:21 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,RCVD_IN_XBL,RP_MATCHES_RCVD,USER_IN_WHITELIST
	autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:51951)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO3U-0002KG-CU
	for submit <at> debbugs.gnu.org; Sat, 25 May 2013 19:39:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47213)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO3T-0007Y0-78
	for bug-gnu-emacs@HIDDEN; Sat, 25 May 2013 19:39:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO3O-0002Dx-02
	for bug-gnu-emacs@HIDDEN; Sat, 25 May 2013 19:39:18 -0400
Received: from mout.web.de ([212.227.17.11]:63612)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UgO3N-0002Cz-Ms
	for bug-gnu-emacs@HIDDEN; Sat, 25 May 2013 19:39:13 -0400
Received: from drachen.dragon ([82.113.98.88]) by smtp.web.de (mrweb001) with
	ESMTPSA (Nemesis) id 0MT8sw-1Uqnw83Sje-00RY3l for
	<bug-gnu-emacs@HIDDEN>; Sun, 26 May 2013 01:39:12 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50; Zombie subprocesses (again)
Date: Sun, 26 May 2013 01:38:56 +0200
Message-ID: <87ppwevddb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:Q25SZT1iDTes/tsEbs7WuWKTz0OM6egqIMycvp9svV3
	rJBUJpTQbS7aLFMjQSVVIf1cgMgkMi/ua3gjjnyCSsUXqFEKRl
	35q9PPm5UMSF6SC+7w8ejOI47m1Whr0GAzRm/YlCH5jNsGudt/
	J2FNuKc3vtqpDpFbwqq3Bq2xffLcgxZB/NfP3uvU+6rzM+J7aQ
	c6uBuVHdqRLsi9ATN6XKRuo21CRbQUdA4B1Y89KNiU=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: michael_heerdegen@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)


Hello,

dunno if this is related to bug#12980.  Although I had used a fresh
build all the time, I saw the following problem yesterday for the first
time (note: was on a trip before, so the problem could have been
introduced one or two weeks before today).

I'm using emacs-snapshot on Debian, currently a five days old build:

"GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-05-21 on dex, modified by Debian"

I'm experiencing the following:

- I start Emacs in X as a different user (via gksu), or

- I start Emacs from an X session that was started with startx

In such an Emacs, any child process seems to become a zombie after being
finished.  E.g., after typing "exit" in a *terminal* running bash, there
is still a running buffer process.  As a symptom, CPU is used
continuously at 100% until I C-x C-c.

However, if I log in via display manager and don't switch to another
user via gksu, this doesn't happen.  And: it happens with the gtk
version as well as with the lucid version, but _not_ with emacs -nw in
an xterm.

Please ask me if you need more info.


Thanks,

Michael.




In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-05-21 on dex, modified by Debian
 (emacs-snapshot package, version 2:20130520-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure --build x86_64-linux-gnu --host x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man
 --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp
 --without-compress-info --with-crt-dir=/usr/lib/x86_64-linux-gnu/
 --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes
 CFLAGS='-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2'
 CPPFLAGS='-D_FORTIFY_SOURCE=2' LDFLAGS='-g -Wl,--as-needed
 -znocombreloc''





Acknowledgement sent to michael_heerdegen@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#14474; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.