Subject: Re: bug#77233: 31.0.50; crash if message starts with a space and then without it

From: Eli Zaretskii <[email-masked]>
Date: Mon, 24 Mar 2025 14:56:22 +0200

> From: Daniel Clemente <[email-masked]>
> Date: Mon, 24 Mar 2025 09:42:52 +0000
> 
> Believe it or not, this crashes each time. Open emacs -Q (with or
> without daemon) in a TTY, and evaluate the first part and then the progn:
> 
> (modify-frame-parameters (selected-frame) '(
>       ;; background-color needs to be defined, to crash. The precise
> color doesn't matter
>       (background-color . "#111")
>       ;; Doesn't affect the crash:
>       ;; (foreground-color . "#c0c0c0")
>      ))
> (progn
>   (message " AB")
>   (message "AB")
> )

Thanks.

I cannot reproduce the crash.  My build is a bit different (for
example, not --without-x), but otherwise I have no clue.

> #2  0x00005555556730a9 in cmcheckmagic (tty=0x555555a983a0) at cm.c:122
> 122        emacs_abort ();
> (gdb) list
> 117      if (frame_size_change_delayed (XFRAME (tty->top_frame)))
> 118        return;
> 119      if (curX (tty) == FrameCols (tty))
> 120        {
> 121          if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
> 122        emacs_abort ();
> 123          if (tty->termscript)
> 124        putc ('\r', tty->termscript);
> 125          putc ('\r', tty->output);
> 126          if (tty->termscript)
> (gdb) p curY(tty)
> $1 = 60
> (gdb) p FrameRows(tty)-1
> $2 = 60
> (gdb) p FrameCols(tty)
> $3 = 100
> (gdb)

What is the value of curX(tty) ?  And if (as I'd expect) it is 100,
then do you have any idea how come it became 100 for a 2-character
message?

Can anyone else reproduce this?