all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71274@debbugs.gnu.org
Subject: bug#71274: 30.0.50; assertion failed: w->window_end_valid, in find_first_unchanged_at_end_row
Date: Fri, 31 May 2024 10:08:18 +0000	[thread overview]
Message-ID: <CAJKAhPBnjFbs5Zsp-O-sRi8_3u1264+GPXtZiQj1yaP7rtx1jw@mail.gmail.com> (raw)
In-Reply-To: <86le3rr0lm.fsf@gnu.org>

> However, find_first_unchanged_at_end_row is called from try_window_id:
> > #3  0x00005555555de527 in try_window_id (w=0x5555622c4f68) at xdisp.c:22347
> And that function already checked that w->window_end_valid is
> non-zero, several dozens of lines before that:
>     /* Verify that display wasn't paused.  */
>     if (!w->window_end_valid)
>       GIVE_UP (8);

Between this check (the one "several dozens of lines before that"),
and the call to find_first_unchanged_at_end_row, something has the
side effect of changing window_end_valid to false. In particular:


  if (last_unchanged_at_beg_row)
    {
      /* Avoid starting to display in the middle of a character, a TAB
     for instance.  This is easier than to set up the iterator
     exactly, and it's not a frequent case, so the additional
     effort wouldn't really pay off.  */
      while ((MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (last_unchanged_at_beg_row)
          || last_unchanged_at_beg_row->ends_in_newline_from_string_p)
         && last_unchanged_at_beg_row > w->current_matrix->rows)
    --last_unchanged_at_beg_row;

      if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (last_unchanged_at_beg_row))
    GIVE_UP (17);

      if (! init_to_row_end (&it, w, last_unchanged_at_beg_row))
    GIVE_UP (18);


Before that last init_to_row_end, w->window_end_valid was true, and,
after it, it was false.
I saw it through fprintfs added before and after the line.
It's not always like that; sometimes it just stays true all through. I
still don't know the conditions to reproduce this, but I have seen
this bug 4 or 5 times yesterday+today.

So it must be a side effect of init_to_row_end.

I didn't have to read its code yet.


By the way, could this comment in try_window_id explain what is
happening? Maybe this part needs to be moved earlier.

  /* The redisplay iterations in display_line above could have
     triggered font-lock, which could have done something that
     invalidates IT->w window's end-point information, on which we
     rely below.  E.g., one package, which will remain unnamed, used
     to install a font-lock-fontify-region-function that called
     bury-buffer, whose side effect is to switch the buffer displayed
     by IT->w, and that predictably resets IT->w's window_end_valid
     flag, which we already tested at the entry to this function.
     Amply punish such packages/modes by giving up on this
     optimization in those cases.  */
  if (!w->window_end_valid)
    {
      clear_glyph_matrix (w->desired_matrix);
      return -1;
    }





  reply	other threads:[~2024-05-31 10:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  9:51 bug#71274: 30.0.50; assertion failed: w->window_end_valid, in find_first_unchanged_at_end_row Daniel Clemente
2024-05-30 11:38 ` Eli Zaretskii
2024-05-31 10:08   ` Daniel Clemente [this message]
2024-05-31 11:11     ` Eli Zaretskii
2024-06-03 17:50       ` Daniel Clemente
2024-06-03 18:14         ` Eli Zaretskii
2024-06-06 12:39           ` Daniel Clemente
2024-06-06 13:35             ` 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=CAJKAhPBnjFbs5Zsp-O-sRi8_3u1264+GPXtZiQj1yaP7rtx1jw@mail.gmail.com \
    --to=n142857@gmail.com \
    --cc=71274@debbugs.gnu.org \
    --cc=eliz@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.