From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14970: crash deleting frames Date: Sun, 28 Jul 2013 18:28:25 +0300 Message-ID: <83zjt6ya92.fsf@gnu.org> References: <51F4D8DA.9090806@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1375025355 18368 80.91.229.3 (28 Jul 2013 15:29:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jul 2013 15:29:15 +0000 (UTC) Cc: lekktu@gmail.com, 14970@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 28 17:29:16 2013 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 1V3SuJ-00009Q-RG for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 17:29:15 +0200 Original-Received: from localhost ([::1]:36481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3SuJ-0005ih-BJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 11:29:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3SuB-0005gF-VN for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2013 11:29:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3Su6-0004b7-K5 for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2013 11:29:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3Su6-0004b3-Gd for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2013 11:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V3Su6-00075f-5C for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2013 11:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2013 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14970 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14970-submit@debbugs.gnu.org id=B14970.137502531127191 (code B ref 14970); Sun, 28 Jul 2013 15:29:02 +0000 Original-Received: (at 14970) by debbugs.gnu.org; 28 Jul 2013 15:28:31 +0000 Original-Received: from localhost ([127.0.0.1]:54533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V3Sta-00074T-FA for submit@debbugs.gnu.org; Sun, 28 Jul 2013 11:28:30 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:41019) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V3StX-00073y-9L for 14970@debbugs.gnu.org; Sun, 28 Jul 2013 11:28:28 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MQN00500JSJFE00@a-mtaout21.012.net.il> for 14970@debbugs.gnu.org; Sun, 28 Jul 2013 18:28:21 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQN0054VKB8DS60@a-mtaout21.012.net.il>; Sun, 28 Jul 2013 18:28:20 +0300 (IDT) In-reply-to: <51F4D8DA.9090806@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:76733 Archived-At: > Date: Sun, 28 Jul 2013 10:39:54 +0200 > From: martin rudalics > Cc: 14970@debbugs.gnu.org > > > 3216 w = XWINDOW (FRAME_SELECTED_WINDOW (f)); > > My crystal ball tells me that Eli will check whether f is a live frame > in between the following two statements of w32fns.c > > f = x_window_to_frame (dpyinfo, hwnd); > w = XWINDOW (FRAME_SELECTED_WINDOW (f)); The Force is strong with you. Yes, I did something similar, although not exactly (you cannot just use FRAME_LIVE_P here, because it will crash in the same way). > which should considerably reduce the danger that the frame has been > recycled when accessing FRAME_SELECTED_WINDOW. Actually, I think it's recycled between the code that sent WM_IME_STARTCOMPOSITION to the window and this code (which runs in a different thread). > I'm not sure whether it's worth the effort having > FRAME_SELECTED_WINDOW check that its argument is a live frame. No, of course not. We already test the value returned by x_window_to_frame almost everywhere, so this place should not be different.