GNU bug report logs - #14161
assertion failed: EQ (selected_window, XFRAME (selected_frame)->selected_window)

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Mon, 8 Apr 2013 17:45:01 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 14161 <at> debbugs.gnu.org
Cc: Dmitry Antipov <dmantipov <at> yandex.ru>
Subject: bug#14161: assertion failed: EQ (selected_window, XFRAME (selected_frame)->selected_window)
Date: Mon, 08 Apr 2013 14:06:22 -0400
> 1) ./src/emacs -nw -Q
> 2) M-x make-frame-on-display :0
> 3) Move mouse to new X frame and left-click;
> 4) Move mouse back to TTY frame and left-click;
> 5) Press C-g staying in TTY frame ==>

> #2  0x000000000065d92d in die (msg=0x79db98 "assertion failed: EQ
> (selected_window, XFRAME (selected_frame)->selected_window)", file=
>      0x79b560 "src/xdisp.c", line=11427) at src/alloc.c:6522

I've installed the patch below which seems to fix this problem for me.


        Stefan


=== modified file 'src/window.c'
--- src/window.c	2013-04-02 01:54:56 +0000
+++ src/window.c	2013-04-08 17:58:36 +0000
@@ -485,12 +485,6 @@
   w = XWINDOW (window);
   w->frozen_window_start_p = 0;
 
-  if (NILP (norecord))
-    {
-      w->use_time = ++window_select_count;
-      record_buffer (w->contents);
-    }
-
   /* Make the selected window's buffer current.  */
   Fset_buffer (w->contents);
 
@@ -515,6 +509,15 @@
 
   select_window_1 (window, inhibit_point_swap);
 
+  /* record_buffer can run QUIT, so make sure it is run only after we have
+     re-established the invariant between selected_window and selected_frame,
+     otherwise the temporary broken invariant might "escape" (bug#14161).  */
+  if (NILP (norecord))
+    {
+      w->use_time = ++window_select_count;
+      record_buffer (w->contents);
+    }
+
   bset_last_selected_window (XBUFFER (w->contents), window);
   windows_or_buffers_changed++;
   return window;





This bug report was last modified 12 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.