From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Killing a frame sometimes kills emacs Date: Thu, 17 Nov 2011 11:10:13 +0100 Message-ID: <8762ijjbzu.fsf@tsdh.uni-koblenz.de> References: <87d3flnxoo.fsf@thinkpad.tsdh.de> <83fwkhdld0.fsf@gnu.org> <871uw04lr9.fsf@thinkpad.tsdh.de> <87sjog35jj.fsf@thinkpad.tsdh.de> <4E5F7ECD.9060601@swipnet.se> <838vq8e0x5.fsf@gnu.org> <87sjn03tzx.fsf@thinkpad.tsdh.de> <87sjmzbmvv.fsf@thinkpad.tsdh.de> <87vcrvm0dr.fsf@stupidchicken.com> <87aa96ogb3.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321524636 3780 80.91.229.12 (17 Nov 2011 10:10:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2011 10:10:36 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org, schwab@linux-m68k.org, James Cloos , Eli Zaretskii , "Jan D." , Ulrich Mueller To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 17 11:10:30 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 1RQyvN-0006CF-CJ for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 11:10:29 +0100 Original-Received: from localhost ([::1]:37518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQyvM-0003nS-Qf for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 05:10:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQyvK-0003n5-3W for emacs-devel@gnu.org; Thu, 17 Nov 2011 05:10:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQyvD-0001cs-UK for emacs-devel@gnu.org; Thu, 17 Nov 2011 05:10:25 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:45846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQyvB-0001bv-Ea; Thu, 17 Nov 2011 05:10:17 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 19ACCD2438; Thu, 17 Nov 2011 11:10:16 +0100 (CET) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id clT1grT41Olg; Thu, 17 Nov 2011 11:10:15 +0100 (CET) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from tsdh.uni-koblenz.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 23174D2423; Thu, 17 Nov 2011 11:10:14 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Wed, 12 Oct 2011 08:57:30 -0400") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 141.26.64.15 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:146071 Archived-At: Stefan Monnier writes: Hi Stefan, >> I commente 3 lines as indicated below: > >> --8<---------------cut here---------------start------------->8--- >> /* If needed, delete the terminal that this frame was on. >> (This must be done after the frame is killed.) */ >> terminal->reference_count--; >> if (terminal->reference_count == 0) >> { >> // Lisp_Object tmp; >> // XSETTERMINAL (tmp, terminal); > >> kb = NULL; >> // Fdelete_terminal (tmp, NILP (force) ? Qt : force); >> } >> else >> kb = terminal->kboard; >> --8<---------------cut here---------------end--------------->8--- > >> I'm not sure if keeping the "kb = NULL;" was correct, though. If you >> want, I can try again with the complete then block commented. > > I'd suggest to only comment out the "terminal->reference_count--;". I did that by using the patch below for about one month. Since then, the crashes I had are gone, and working with multiple emacs X frames is fun again. Should I go ahead and commit? --8<---------------cut here---------------start------------->8--- === modified file 'src/frame.c' --- src/frame.c 2011-11-17 09:09:20 +0000 +++ src/frame.c 2011-11-17 10:05:11 +0000 @@ -1358,7 +1358,11 @@ /* If needed, delete the terminal that this frame was on. (This must be done after the frame is killed.) */ - terminal->reference_count--; + + // FIXME: Deleting the terminal crashes emacs because of a GTK + // bug. See the thread starting with <87d3flnxoo.fsf@thinkpad.tsdh.de> + // on emacs-devel. + // terminal->reference_count--; if (terminal->reference_count == 0) { Lisp_Object tmp; --8<---------------cut here---------------end--------------->8--- Bye, Tassilo -- (What the world needs (I think) is not (a Lisp (with fewer parentheses)) but (an English (with more.))) Brian Hayes, http://tinyurl.com/3y9l2kf