From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Emacs daemon dies at Xorg crash Date: Wed, 17 Dec 2008 11:03:22 -0500 Message-ID: <87k59yssad.fsf@cyd.mit.edu> References: <1229454957.21129.0.camel@localhost> <18760.56870.137654.853165@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229529887 12285 80.91.229.12 (17 Dec 2008 16:04:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 16:04:47 +0000 (UTC) Cc: "Diego E. 'Flameeyes' =?utf-8?Q?Petten=C3=B2?=" , emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 17 17:05:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LCyt9-0003kl-2n for ged-emacs-devel@m.gmane.org; Wed, 17 Dec 2008 17:04:43 +0100 Original-Received: from localhost ([127.0.0.1]:33562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCyrx-0002V3-3n for ged-emacs-devel@m.gmane.org; Wed, 17 Dec 2008 11:03:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCyrr-0002RE-AG for emacs-devel@gnu.org; Wed, 17 Dec 2008 11:03:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCyrq-0002Qo-Vc for emacs-devel@gnu.org; Wed, 17 Dec 2008 11:03:23 -0500 Original-Received: from [199.232.76.173] (port=33019 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCyrq-0002Qe-PB for emacs-devel@gnu.org; Wed, 17 Dec 2008 11:03:22 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:42746) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LCyrq-0002lW-AV for emacs-devel@gnu.org; Wed, 17 Dec 2008 11:03:22 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id AB2D457E1D1; Wed, 17 Dec 2008 11:03:22 -0500 (EST) In-Reply-To: <18760.56870.137654.853165@a1ihome1.kph.uni-mainz.de> (Ulrich Mueller's message of "Wed, 17 Dec 2008 12:10:30 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107009 Ulrich Mueller writes: > AFAICS Emacs only dies if there's no other connection open. I've > tested it with another client open on a tty, and Emacs survived. > > The last thing it outputs is "Connection lost to X server `:0.0'", so > it passes through x_io_error_quitter, which in turn will call > x_connection_closed. > > In x_connection_closed there are two tests for the last terminal, > where shut_down_emacs is called. Probably this should be modified for > the daemon case? I'm not sure this is the problem. The two tests you mention are if (terminal_list->next_terminal == NULL) where terminal_list points to the X terminal about to be deleted, and if (terminal_list == 0) after the deletion of the terminal. Unless the code has changed since the last time I looked at it, Emacs uses an initial terminal, which neither sends nor receives anything, when it is run as a daemon; the existence of this initial terminal should prevent shut_down_emacs from being called. I suspect that closing X also closes the initial terminal, somehow.