GNU bug report logs -
#13007
24.3.50; emacs_backtrace.txt
Previous Next
Full log
Message #92 received at 13007 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 29 Nov 2012 21:23:37 +0400
> From: Dmitry Antipov <dmantipov <at> yandex.ru>
> CC: 13007 <at> debbugs.gnu.org, lekktu <at> gmail.com, drew.adams <at> oracle.com
>
> On 11/29/2012 08:46 PM, Eli Zaretskii wrote:
>
> > For starters, can you tell what triggered the assertion violation in
> > Juanma's case? IOW, how did we wind up in a situation where (AFAIU)
> > the selected window displays a buffer other than the current one?
>
> IIUC, here is the sequence:
>
> Function set_window_buffer (W, B, ...) is called where W is selected_window
> and XBUFFER (B) != current_buffer. This function temporary sets current
> buffer to XBUFFER (B) to run hooks, and then restore old current_buffer [1].
> So, on exit we have XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer,
> and these gets _finally_ synchronized only when read_key_sequence is called with
> fix_current_buffer == true [2]. If redisplay is invoked between [1] and [2],
> its routines may see the condition which was eassert'ed; _finally_ means
> that some redisplay routines may do the synchronization temporary and
> then restore original value of current buffer (see pos_visible_p for example).
OK. So what do you suggest, in practical terms? Are you saying that
we should use BUF_MODIFF(XBUFFER (w->buffer)) instead of MODIFF and
BUF_OVERLAY_MODIFF(XBUFFER (w->buffer)) instead of OVERLAY_MODIFF
inside window_outdated? Or do you suggest something else?
I'm okay with using BUF_* macros in window_outdated.
My reading of redisplay_internal is that it goes by the selected
window, not assuming that the buffer of that window is the current
buffer. But when redisplay_window is called, it temporarily selects
the window's buffer as current buffer, and all the functions called by
redisplay_window then rely on that.
So if window_outdated is called not from redisplay_window or its
subroutines, we cannot assume that current_buffer and the selected
window's buffer are the same. Also, for minibuffer windows and
pseudo-windows, we may need more care, but I'm not sure.
This bug report was last modified 9 years and 199 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.