From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#8855: dbus error at startup Date: Thu, 25 Oct 2012 13:57:40 -0700 Message-ID: <5089A7C4.2090800@cs.ucla.edu> References: <5088CF93.2020802@cs.ucla.edu> <83y5iua59n.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351198683 27859 80.91.229.3 (25 Oct 2012 20:58:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2012 20:58:03 +0000 (UTC) Cc: 8855@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 25 22:58:11 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRUVF-00060y-EF for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 22:58:09 +0200 Original-Received: from localhost ([::1]:42252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRUV7-0000GG-QV for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 16:58:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRUV4-0000Fz-KA for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 16:57:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRUV3-0008QQ-KX for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 16:57:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRUV3-0008QM-GL for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 16:57:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TRUX4-0000Zx-Ac for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 17:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Oct 2012 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 8855-submit@debbugs.gnu.org id=B8855.13511987902187 (code B ref 8855); Thu, 25 Oct 2012 21:00:02 +0000 Original-Received: (at 8855) by debbugs.gnu.org; 25 Oct 2012 20:59:50 +0000 Original-Received: from localhost ([127.0.0.1]:33748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRUWr-0000ZD-JD for submit@debbugs.gnu.org; Thu, 25 Oct 2012 16:59:50 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:57035) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRUWp-0000Z4-6Y for 8855@debbugs.gnu.org; Thu, 25 Oct 2012 16:59:48 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 64ADBA60022; Thu, 25 Oct 2012 13:57:41 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j9S24s2a8hex; Thu, 25 Oct 2012 13:57:40 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id D9518A60003; Thu, 25 Oct 2012 13:57:40 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 In-Reply-To: <83y5iua59n.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66057 Archived-At: On 10/25/2012 09:24 AM, Eli Zaretskii wrote: > is there perhaps a way to fix this less intrusively, > without messing with the whole chain of functions involved in SIGCHLD > and subprocess termination? I looked for one but couldn't find one. We could try to get the glib API fixed, but I can't offhand think of an easy fix, and in the meantime we need to deal with the glibs in the field with the current API, and for those glibs we need a workaround anyway. We could try to use process groups, so that Emacs invokes waitpid just on a process group rather than on all children. However, an executable can create a new process group and join it so this would require that we create two processes instead of one (the child simply forks and waits for the grandchild which does the real work, so that any mucking around by the grandchild cannot affect the child's process group). This would work, but it costs us one extra process per subprocess, and I expect that in practice that'd be worse than the proposed patch, both performance-wise and intrusive-change-wise. glib itself, when faced with this problem, does not use process groups, but simply scans for all subprocesses that it knows about, just as the proposed patch does. See the function dispatch_unix_signals in glib/gmain.c. Looking at that function's callers, it may be that we can use g_child_watch_source_new instead of waitpid, but it's not clear to me how that would work, and I wonder whether the result would be any less intrusive than the proposed patch.