From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Killing a frame sometimes kills emacs Date: Thu, 01 Sep 2011 06:27:21 -0400 Message-ID: References: <87d3flnxoo.fsf@thinkpad.tsdh.de> <83fwkhdld0.fsf@gnu.org> <871uw04lr9.fsf@thinkpad.tsdh.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1314872858 19992 80.91.229.12 (1 Sep 2011 10:27:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2011 10:27:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 01 12:27:32 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qz4Ue-0005cT-4j for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2011 12:27:32 +0200 Original-Received: from localhost ([::1]:48155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz4Ud-00030B-Ki for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2011 06:27:31 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz4Ub-0002zz-H5 for emacs-devel@gnu.org; Thu, 01 Sep 2011 06:27:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz4UW-0003sC-3W for emacs-devel@gnu.org; Thu, 01 Sep 2011 06:27:26 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:44100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz4UT-0003qy-Tk; Thu, 01 Sep 2011 06:27:21 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Qz4UT-0007nc-RY; Thu, 01 Sep 2011 06:27:21 -0400 In-reply-to: <871uw04lr9.fsf@thinkpad.tsdh.de> (message from Tassilo Horn on Thu, 01 Sep 2011 12:09:30 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143681 Archived-At: > From: Tassilo Horn > Cc: emacs-devel@gnu.org > Date: Thu, 01 Sep 2011 12:09:30 +0200 > > Eli Zaretskii writes: > > Hi Eli, > > >> From: Tassilo Horn > >> Date: Wed, 31 Aug 2011 22:16:55 +0200 > >> > >> Do you have any suggestions on how to debug this issue? > > > > Run Emacs under a debugger, put a breakpoint on Fkill_emacs, and when > > this happens again, tell use who called it by showing the backtrace. > > It turned out to be a crash, not something calling Fkill_emacs. Here's > the backtrace: What about the Lisp backtrace? And since this is an optimized build, the backtrace is almost useless anyway. Can you try reproducing this in an unoptimized build? > #7 0x00000000004e157c in xg_display_close (dpy=0x6ca0020) at gtkutil.c:182 > gdpy = 0xd682e0 > #8 0x00000000004afc49 in x_delete_terminal (terminal=) > at xterm.c:10607 > dpyinfo = 0x698d3e0 > #9 0x00000000004a40f2 in Fdelete_terminal (terminal=107998581, > force=) at terminal.c:345 > t = 0x66fed70 > #10 0x00000000004235cc in delete_frame (frame=99991829, force=) > at frame.c:1379 > tmp = > terminal = > f = 0x5f5c110 > sf = 0x121b7e0 > kb = 0x0 > minibuffer_selected = 0 > tooltip_frame = 0 > #11 0x000000000042382a in Fdelete_frame (frame=, > force=) at frame.c:1516 This part does look as if Emacs was going to close the X display where the frame was displayed. Were all other frames in that session on other displays? If not, how come Emacs is about to delete the terminal? Here's the relevant code: if (terminal->reference_count == 0) { Lisp_Object tmp; XSETTERMINAL (tmp, terminal); kb = NULL; Fdelete_terminal (tmp, NILP (force) ? Qt : force); } Can you look at the value of terminal->reference_count?