all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: 13007@debbugs.gnu.org
Subject: bug#13007: 24.3.50; emacs_backtrace.txt
Date: Wed, 28 Nov 2012 11:19:29 +0400	[thread overview]
Message-ID: <50B5BB01.2070304@yandex.ru> (raw)
In-Reply-To: <834nkbx7if.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

IIUC crash is triggered by this fragment:

  13212    else if (EQ (selected_window, minibuf_window)
  13213             && (current_buffer->clip_changed || window_outdated (w))
  13214             && resize_mini_window (w, 0))

So selected_window is the same as minibuf_window, and w->buffer is not the
same as current_buffer; but, is w equal to XWINDOW (selected_window) here?

Look above:

  13114    /* Notice any pending interrupt request to change frame size.  */
  13115    do_pending_window_change (1);
  13116
  13117    /* do_pending_window_change could change the selected_window due to
  13118       frame resizing which makes the selected window too small.  */
  13119    if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
  13120      {
  13121        sw = w;
  13122        reconsider_clip_changes (w, current_buffer);
  13123      }
  13124
  13125    /* Clear frames marked as garbaged.  */
  13126    clear_garbaged_frames ();
  13127
  13128    /* Build menubar and tool-bar items.  */
  13129    if (NILP (Vmemory_full))
  13130      prepare_menu_bars ();

Here prepare_menu_bars can run Lisp and so change something.

  13131
  13132    if (windows_or_buffers_changed)
  13133      update_mode_lines++;
  13134
  13135    /* Detect case that we need to write or remove a star in the mode line.  */
  13136    if ((SAVE_MODIFF < MODIFF) != w->last_had_star)

If we ran Lisp above, how we can be sure that w is still equal to XWINDOW (selected_window)?

Can someone try this patch?

Dmitry

[-- Attachment #2: 1.patch --]
[-- Type: text/plain, Size: 1416 bytes --]

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-11-27 03:10:32 +0000
+++ src/xdisp.c	2012-11-28 07:13:04 +0000
@@ -10903,6 +10903,9 @@
 static int
 window_outdated (struct window *w)
 {
+  if (w->pseudo_window_p)
+    /* Always update menu bar windows.  */
+    return 1;
   eassert (XBUFFER (w->buffer) == current_buffer);
   return (w->last_modified < MODIFF 
 	  || w->last_overlay_modified < OVERLAY_MODIFF);
@@ -13114,14 +13117,6 @@
   /* 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.  */
   clear_garbaged_frames ();
 
@@ -13129,6 +13124,15 @@
   if (NILP (Vmemory_full))
     prepare_menu_bars ();
 
+  /* Resync because prepare_menu_bars may run Lisp or 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);
+    }
+
   if (windows_or_buffers_changed)
     update_mode_lines++;
 


  parent reply	other threads:[~2012-11-28  7:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  6:23 bug#13007: 24.3.50; emacs_backtrace.txt Drew Adams
2012-11-27  6:28 ` Drew Adams
2012-11-27 15:15   ` Eli Zaretskii
2012-11-27 15:41     ` Drew Adams
2012-11-27 15:44       ` Drew Adams
2012-11-27 16:39     ` Juanma Barranquero
2012-11-27 18:02       ` Eli Zaretskii
2012-11-27 15:14 ` Eli Zaretskii
2012-11-27 16:49   ` Dmitry Antipov
2012-11-27 17:47     ` Eli Zaretskii
2012-11-27 17:58       ` Jambunathan K
2012-11-27 18:10         ` Drew Adams
2012-11-28  7:19       ` Dmitry Antipov [this message]
2012-11-28 13:09         ` Juanma Barranquero
2012-11-28 15:51           ` Dmitry Antipov
2012-11-28 17:59             ` Eli Zaretskii
2012-11-29  6:19               ` Dmitry Antipov
2012-11-29 16:46                 ` Eli Zaretskii
2012-11-29 17:02                   ` Drew Adams
2012-11-29 17:39                     ` Eli Zaretskii
2012-11-29 17:47                       ` Drew Adams
2012-11-29 18:08                         ` Eli Zaretskii
2012-11-29 18:13                           ` Drew Adams
2012-11-29 19:50                             ` Eli Zaretskii
2012-11-29 17:23                   ` Dmitry Antipov
2012-11-30  9:53                     ` Eli Zaretskii
2012-11-30 15:50                       ` Dmitry Antipov
2012-11-30 16:59                         ` Eli Zaretskii
2015-12-29 11:08                       ` Lars Ingebrigtsen
2015-12-29 17:37                         ` Eli Zaretskii
2016-01-02 11:10                           ` Eli Zaretskii
2012-11-29 19:14                   ` Stefan Monnier
2012-11-29 19:54                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B5BB01.2070304@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=13007@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.