GNU bug report logs - #77233
31.0.50; crash if message starts with a space and then without it

Previous Next

Package: emacs;

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

Date: Mon, 24 Mar 2025 09:44:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 77233 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Clemente <n142857 <at> gmail.com>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 77233 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#77233: 31.0.50; crash if message starts with a space and then
 without it
Date: Wed, 26 Mar 2025 14:24:04 +0000
[Message part 1 (text/plain, inline)]
> > If it's urgent, maybe try to comment out the emacs_abort in cmcheckmagic
> > and see if that suffices.
>
> That avoids the crash here, and things work fine in an xterm, but it
> means we printed a character with the cursor at (cols-1,rows-1), which
> allegedly would have caused some (old, I assume?) terminals to scroll by
> a line, destroying the entire Emacs layout...
>
> However, xterm and M-x term both handle this situation sensibly, not
> scrolling the frame.  Is anyone aware of a terminal emulator that
> scrolls in this situation?

If I comment the emacs_abort, I see everything scroll 1 line upwards,
in many terminals: xterm, urxvt, mlterm, Eterm, lxterm,
cool-retro-term.
Every C-x C-e scrolls it 1 line. C-l fixes it.
I have several customizations in .Xresources that may affect what I'm
seeing in some terminal, but not in all the ones I tested.  I don't
know why doesn't your Emacs-in-xterm scroll. Did you run the part that
sets the background color?


On first thought it seems safer to avoid printing at (cols-1, rows-1)
when we know that AutoWrap is enabled…

I know this is a different language and scenario, but I just checked
ncurses in Python, and it rejects writing at the bottom right corner:
  File "/n/cursor1.py", line 41, in main
    stdscr.addstr(y, x, letter, curses.color_pair(1))
_curses.error: addwstr() returned ERR

However, with C and using terminal sequences, I saw it's possible to
print at the bottom right without scrolling, in all of the terminal
emulators mentioned above.
I attach a test program that prints a letter in all four corners and
in the center, and doesn't scroll.
I don't know why Emacs scrolls but this test program doesn't (even
with autoscroll on). I don't know enough about terminals, so please
forgive my small mistakes.
[cursor2.c (text/x-csrc, attachment)]

This bug report was last modified 52 days ago.

Previous Next


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