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#8020: 23.2.93; assertion failure on fast frame resize Date: Sat, 12 Feb 2011 10:50:49 +0200 Message-ID: <837hd5r5zq.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1297501608 27545 80.91.229.12 (12 Feb 2011 09:06:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 09:06:48 +0000 (UTC) Cc: 8020@debbugs.gnu.org To: YAMAMOTO Mitsuharu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 12 10:06:43 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PoBRA-0003Pm-3m for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Feb 2011 10:06:40 +0100 Original-Received: from localhost ([127.0.0.1]:35167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBR3-0005HY-IV for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Feb 2011 04:06:33 -0500 Original-Received: from [140.186.70.92] (port=38308 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBQw-0005HH-5y for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2011 04:06:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoBQq-0003rF-UD for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2011 04:06:26 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoBQq-0003rB-SO for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2011 04:06:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PoB4H-00024v-Ui; Sat, 12 Feb 2011 03:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Feb 2011 08:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8020-submit@debbugs.gnu.org id=B8020.12975001537951 (code B ref 8020); Sat, 12 Feb 2011 08:43:01 +0000 Original-Received: (at 8020) by debbugs.gnu.org; 12 Feb 2011 08:42:33 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoB3o-00024C-MW for submit@debbugs.gnu.org; Sat, 12 Feb 2011 03:42:32 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoB3m-000240-89 for 8020@debbugs.gnu.org; Sat, 12 Feb 2011 03:42:31 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LGH00C00XKY7M00@a-mtaout22.012.net.il> for 8020@debbugs.gnu.org; Sat, 12 Feb 2011 10:50:30 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.171.5]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LGH00BDUXW4NFC0@a-mtaout22.012.net.il>; Sat, 12 Feb 2011 10:50:30 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 12 Feb 2011 03:43:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44061 Archived-At: > Date: Sat, 12 Feb 2011 11:30:28 +0900 > From: YAMAMOTO Mitsuharu > Cc: > > This is forked from Bug#7348, and some analysis can be found there. > (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7348) > > Steps to reproduce: > > 1. Build emacs with --enable-checking > 2. emacs -Q > 3. C-x 2 > 4. Move your mouse to the corner of the frame, grab it, drag up, > rescaling the vertically to minimum size > > Result: > > ../src/xdisp.c:11515: Emacs fatal error: assertion failed: BUFFERP(w->buffer) > > The value of w->buffer was nil when the assertion failure occurred. Please try the patch below, which is based on the discussions in bug #7348. The patch seems to solve the bug on MS-Windows. If it works for you on another platform, and doesn't cause problems elsewhere, I will install it on the emacs-23 branch. Thanks. --- src/xdisp.c.orig 2011-01-26 20:15:42.000000000 +0200 +++ src/xdisp.c 2011-02-12 10:48:56.296875000 +0200 @@ -11261,6 +11261,7 @@ int preserve_echo_area; { struct window *w = XWINDOW (selected_window); + struct window *sw; struct frame *f; int pause; int must_finish = 0; @@ -11331,6 +11332,9 @@ } retry: + /* Remember the currently selected window. */ + sw = w; + if (!EQ (old_frame, selected_frame) && FRAME_LIVE_P (XFRAME (old_frame))) /* When running redisplay, we play a bit fast-and-loose and allow e.g. @@ -11396,6 +11400,14 @@ /* Notice any pending interrupt request to change frame size. */ do_pending_window_change (1); + /* do_pending_window_change could change the selected_window due to + frame resizing which makes the selected window too small. */ + if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) + { + sw = w; + reconsider_clip_changes (w, current_buffer); + } + /* Clear frames marked as garbaged. */ if (frame_garbaged) clear_garbaged_frames (); @@ -11665,6 +11677,10 @@ if (!must_finish) { do_pending_window_change (1); + /* If selected_window changed, redisplay again. */ + if (WINDOWP (selected_window) + && (w = XWINDOW (selected_window)) != sw) + goto retry; /* We used to always goto end_of_redisplay here, but this isn't enough if we have a blinking cursor. */ @@ -11959,8 +11975,9 @@ do_pending_window_change (1); /* If we just did a pending size change, or have additional - visible frames, redisplay again. */ - if (windows_or_buffers_changed && !pause) + visible frames, or selected_window changed, redisplay again. */ + if ((windows_or_buffers_changed && !pause) + || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)) goto retry; /* Clear the face cache eventually. */