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#11984: 24.1; segfault while deleting a window Date: Sat, 21 Jul 2012 12:32:43 +0300 Message-ID: <83pq7p7938.fsf@gnu.org> References: <83r4s88n7n.fsf@gnu.org> <87txx47724.fsf@gnu.org> <87boj97hhb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1342863231 13291 80.91.229.3 (21 Jul 2012 09:33:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2012 09:33:51 +0000 (UTC) Cc: cyd@gnu.org, 11984@debbugs.gnu.org To: Russell Sim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 11:33:51 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 1SsW4G-0007sx-Ih for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2012 11:33:44 +0200 Original-Received: from localhost ([::1]:47771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsW4F-0004Du-Qk for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2012 05:33:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsW4D-0004Do-MX for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 05:33:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsW4C-0003o0-G5 for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 05:33:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsW4C-0003nw-CY for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 05:33:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SsWAL-0007ut-RN for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 05:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jul 2012 09:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11984-submit@debbugs.gnu.org id=B11984.134286354730356 (code B ref 11984); Sat, 21 Jul 2012 09:40:01 +0000 Original-Received: (at 11984) by debbugs.gnu.org; 21 Jul 2012 09:39:07 +0000 Original-Received: from localhost ([127.0.0.1]:53898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SsW9T-0007tY-1w for submit@debbugs.gnu.org; Sat, 21 Jul 2012 05:39:07 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:48331) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SsW9Q-0007tO-MU for 11984@debbugs.gnu.org; Sat, 21 Jul 2012 05:39:06 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M7I00A007J3WS00@a-mtaout22.012.net.il> for 11984@debbugs.gnu.org; Sat, 21 Jul 2012 12:32:41 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M7I00A0Q7UHSE20@a-mtaout22.012.net.il>; Sat, 21 Jul 2012 12:32:41 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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:62223 Archived-At: > From: Russell Sim > Cc: Eli Zaretskii , 11984@debbugs.gnu.org > Date: Sat, 21 Jul 2012 19:00:36 +1000 > > > Hmm, I'm not sure the core file loaded properly for me. Can you trigger > > the crash with Emacs running in gdb? Do you get the following strange > > result from printing f->output_data? > > > > (gdb) p f->output_data > > $4 = { > > tty = 0xc2, > > x = 0xc2, > > w32 = 0xc2, > > ns = 0xc2, > > nothing = 194 > > } > > (gdb) p f->output_data > $1 = {tty = 0x0, x = 0x0, w32 = 0x0, ns = 0x0, nothing = 0} This is a FRAME_INITIAL_P frame. > 2652: BLOCK_INPUT; > 2653: hlinfo = MOUSE_HL_INFO (f); > 2654: /* We are going to free the glyph matrices of WINDOW, and with that > 2655: we might lose any information about glyph rows that have some of > 2656: their glyphs highlighted in mouse face. (These rows are marked > 2657: with a non-zero mouse_face_p flag.) If WINDOW indeed has some > 2658: glyphs highlighted in mouse face, signal to frame's up-to-date > 2659: hook that mouse highlight was overwritten, so that it will > 2660: arrange for redisplaying the highlight. */ > 2661: if (EQ (hlinfo->mouse_face_window, window)) > 2662: { > 2663: hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; > 2664: hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; > 2665: hlinfo->mouse_face_window = Qnil; > 2666: } That's it your problem: you didn't include the changes below, which make sure mouse-highlight info is never accessed for 'initial' frame types. The changes below were only done on the trunk, they aren't in the emacs-24 branch. --- src/window.c 2012-06-01 03:41:03 +0000 +++ src/window.c 2012-06-16 07:18:44 +0000 @@ -2566,7 +2566,6 @@ window-start value is reasonable when th Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; ptrdiff_t startpos IF_LINT (= 0); int top IF_LINT (= 0), new_top, resize_failed; - Mouse_HLInfo *hlinfo; w = decode_any_window (window); XSETWINDOW (window, w); @@ -2647,19 +2646,23 @@ window-start value is reasonable when th } BLOCK_INPUT; - hlinfo = MOUSE_HL_INFO (f); - /* We are going to free the glyph matrices of WINDOW, and with that - we might lose any information about glyph rows that have some of - their glyphs highlighted in mouse face. (These rows are marked - with a non-zero mouse_face_p flag.) If WINDOW indeed has some - glyphs highlighted in mouse face, signal to frame's up-to-date - hook that mouse highlight was overwritten, so that it will - arrange for redisplaying the highlight. */ - if (EQ (hlinfo->mouse_face_window, window)) - { - hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; - hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; - hlinfo->mouse_face_window = Qnil; + if (!FRAME_INITIAL_P (f)) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + + /* We are going to free the glyph matrices of WINDOW, and with + that we might lose any information about glyph rows that have + some of their glyphs highlighted in mouse face. (These rows + are marked with a non-zero mouse_face_p flag.) If WINDOW + indeed has some glyphs highlighted in mouse face, signal to + frame's up-to-date hook that mouse highlight was overwritten, + so that it will arrange for redisplaying the highlight. */ + if (EQ (hlinfo->mouse_face_window, window)) + { + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + } } free_window_matrices (r); @@ -3903,7 +3906,6 @@ Signal an error when WINDOW is the only && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { - Mouse_HLInfo *hlinfo; /* Block input. */ BLOCK_INPUT; @@ -3911,9 +3913,13 @@ Signal an error when WINDOW is the only /* If this window is referred to by the dpyinfo's mouse highlight, invalidate that slot to be safe (Bug#9904). */ - hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); - if (EQ (hlinfo->mouse_face_window, window)) - hlinfo->mouse_face_window = Qnil; + if (!FRAME_INITIAL_P (f)) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + + if (EQ (hlinfo->mouse_face_window, window)) + hlinfo->mouse_face_window = Qnil; + } windows_or_buffers_changed++; Vwindow_list = Qnil;