GNU bug report logs - #73022
31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size

Previous Next

Package: emacs;

Reported by: Daniel Clemente <n142857 <at> gmail.com>

Date: Wed, 4 Sep 2024 06:12:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: n142857 <at> gmail.com, 73022 <at> debbugs.gnu.org
Subject: bug#73022: 31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size
Date: Wed, 11 Sep 2024 15:22:03 +0300
> Date: Wed, 11 Sep 2024 10:07:21 +0200
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 73022 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  > For instance, Eli recently added this code (dispnew.c):
>  >
>  >    /* This should never happen, but evidently sometimes does if one
>  >       resizes the frame quickly enough.  Prevent aborts in cmcheckmagic.  */
>  >    if (vpos >= FRAME_TOTAL_LINES (f))
>  >      return;
>  >
>  > But this is checking the *frame*.  Later, the assertion in
>  > cmcheckmagic will be made about the *terminal*.
> 
> Right.  This should probably be
> 
>    if (FRAME_TERMCAP_P (f) && vpos >= FrameRows (FRAME_TTY (f)))
>      return;

That code is in update_frame_line, which is used only for TTY frames
and uses frame glyph matrices.  IOW, it updates the entire frame as a
single large window.  In addition, on a TTY terminal there's only one
frame visible at any given time, and only that one frame is being
redrawn, ever.

Given the above, why is that code incorrect?

> And it's not about resizing frames "quickly".  Here I can crash it in a
> very slow fashion too.

Good for you, but my comment describes the situation in which I saw
that particular problem.  As I already said, I can never crash Emacs
if I resize the terminal emulator window slowly.

> The cmcheckmagic code is about a very peculiar situation that is hardly
> relevant for today's terminals I think.  Here I can never crash a build
> that doesn't check assertions.

Most probably because the terminal driver simply ignores such writes.
AFAIU, the assertion there is not because of the terminal, it is there
to catch Emacs bugs.




This bug report was last modified 278 days ago.

Previous Next


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