Subject: Re: bug#71289: 30.0.50; cmcheckmagic aborts when tty_write_glyphs writes "Garbage collecting..." in some cases

From: Eli Zaretskii <[email-masked]>
Date: Fri, 31 May 2024 14:17:35 +0300

> From: Daniel Clemente <[email-masked]>
> Date: Fri, 31 May 2024 10:18:35 +0000
> 
> Running emacs --fg-daemon under gdb, and TTY emacs, with glyph debug
> enabled. Using my full .emacs, which includes things like (setq
> garbage-collection-messages t).
> 
> I reproduced this 2 times:
> 
> 1. I opened 2 or 3 emacsclient (inside urxvt) and started resizing the
> X window of one of them, and using it a bit (open org agenda). I admit
> I used weird X window sizes that created a 1x1 terminal, but this
> still worked. After some time playing with the X window size (but
> without opening/closing X windows), this assert failed.
> I was using urxvt with no customizations (i.e. I was seeing a scroll
> bar etc.). In this case I used icewm (non-tiled window manager) with
> no customizations.
> 
> See BT1 below.
> 
> 
> 2. I just ran emacs --fg-daemon inside gdb, and I opened my first TTY
> frame, in a normal window of normal size; nothing weird (no 1x1 frames
> etc). It immediately crashed; this never happened before. I'm using
> wmii, urxvt (many customizations), and a command like urxvt -e
> emacsclient '-nw' '-e' '(dired "~")' &
> 
> See BT2 below.
> 
> 
> Maybe it's because of trying the display the "Garbage
> collecting...done" message in a small window? (BT1) or in window which
> isn't fully initialized yet? (BT2)

Thanks, but these backtraces are not enough, because they don't
explain why was emacs_abort called.  We need to see all the values
involved in this condition:

  if (curX (tty) == FrameCols (tty))
    {
      if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1) <<<<<<<<<<<
	emacs_abort ();