GNU bug report logs - #76997
31.0.50; Freplace_buffer_contents

Previous Next

Package: emacs;

Reported by: nat chapman <nat.chapman <at> proton.me>

Date: Thu, 13 Mar 2025 16:28:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76997 in the body.
You can then email your comments to 76997 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76997; Package emacs. (Thu, 13 Mar 2025 16:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to nat chapman <nat.chapman <at> proton.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Mar 2025 16:28:02 GMT) Full text and rfc822 format available.

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

From: nat chapman <nat.chapman <at> proton.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 31.0.50; Freplace_buffer_contents
Date: Thu, 13 Mar 2025 16:27:13 +0000
[Message part 1 (text/plain, inline)]
under certain circumstances, Freplace_buffer_contents seems to introduce
gibberish into the buffer. i noticed it in org-mode and followed it to
Freplace_buffer_contents with debug, then confirmed with git bisect that
commit 40d8650d517 introduced the problem.

emacs -Q
C-x b test RET
M-x org-mode RET

#+begin_src emacs-lisp
(+ 1 2|)
#+end_src

with point at |, two or three RET begins introducing garbage into the
buffer. sometimes this crashes emacs, but i think that's to do with the
garbage getting read. this copy of emacs was built without x to make the
bisect faster, but i can reproduce it in my normal build of master with
pgtk as well. in my initial testing i saw various different characters,
but in this test build it's consistently ^@. not sure if that is helpful
information, since the initial testing had different CFLAGS.

emacs -Q --eval "(funcall (kmacro \"C-x b t e s t RET M-x o r g - m o \
d e RET # + b e g i n _ s r c SPC e m a c s - l i s p RET # + e n d _ \
s r c C-p C-e RET ( + SPC 1 SPC 2 ) C-b RET RET RET RET RET RET RET \RET RET\"))"

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu) of 2025-03-13 built
on hmslydia
Repository revision: f9d805cef3ef9a9818ef09e77c4379d23c2afb55
Repository branch: makepkg
System Description: Arch Linux

Configured using:
'configure -C --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
--localstatedir=/var --without-all --without-x
--with-native-compilation=no 'CFLAGS=-march=x86-64 -mtune=generic -O2
-pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat
-Werror=format-security -fstack-clash-protection -fcf-protection
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto'
'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro
-Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto'
'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security
-fstack-clash-protection -fcf-protection -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto''

Configured features:
GMP PDUMPER SECCOMP XIM

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
xterm-mouse-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow regexp-opt sort mail-extr emacsbug lisp-mnt message mailcap
yank-media puny dired dnd dired-loaddefs rfc822 mml mml-sec
password-cache epa derived epg rfc6068 epg-config gnus-util
text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils image time-date subr-x cl-loaddefs cl-lib
xt-mouse term/xterm xterm byte-opt gv bytecomp byte-compile rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote multi-tty make-network-process
tty-child-frames emacs)

Memory information:
((conses 16 53189 9736) (symbols 48 6222 0) (strings 32 15038 1609)
(string-bytes 1 377042) (vectors 16 7809) (vector-slots 8 69139 5730)
(floats 8 43 29) (intervals 56 376 0) (buffers 984 12))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76997; Package emacs. (Thu, 13 Mar 2025 20:23:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: nat chapman <nat.chapman <at> proton.me>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 76997 <at> debbugs.gnu.org
Subject: Re: bug#76997: 31.0.50; Freplace_buffer_contents
Date: Thu, 13 Mar 2025 22:22:26 +0200
> Date: Thu, 13 Mar 2025 16:27:13 +0000
> From:  nat chapman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> under certain circumstances, Freplace_buffer_contents seems to introduce
> gibberish into the buffer. i noticed it in org-mode and followed it to
> Freplace_buffer_contents with debug, then confirmed with git bisect that
> commit 40d8650d517 introduced the problem.
> 
> emacs -Q
> C-x b test RET
> M-x org-mode RET
> 
> #+begin_src emacs-lisp
>   (+ 1 2|)
> #+end_src
> 
> with point at |, two or three RET begins introducing garbage into the
> buffer. sometimes this crashes emacs, but i think that's to do with the
> garbage getting read.

Thanks, should be fixed now.

Stefan, would you please eyeball the fix?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76997; Package emacs. (Thu, 13 Mar 2025 20:55:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: nat chapman <nat.chapman <at> proton.me>, 76997 <at> debbugs.gnu.org
Subject: Re: bug#76997: 31.0.50; Freplace_buffer_contents
Date: Thu, 13 Mar 2025 16:54:27 -0400
>> under certain circumstances, Freplace_buffer_contents seems to introduce
>> gibberish into the buffer. i noticed it in org-mode and followed it to
>> Freplace_buffer_contents with debug, then confirmed with git bisect that
>> commit 40d8650d517 introduced the problem.
> Thanks, should be fixed now.
> Stefan, would you please eyeball the fix?

Duh!  Can't believe I missed that.
Thanks for the fix, looks good.


        Stefan





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 14 Mar 2025 07:15:02 GMT) Full text and rfc822 format available.

Notification sent to nat chapman <nat.chapman <at> proton.me>:
bug acknowledged by developer. (Fri, 14 Mar 2025 07:15:02 GMT) Full text and rfc822 format available.

Message #16 received at 76997-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: nat.chapman <at> proton.me, 76997-done <at> debbugs.gnu.org
Subject: Re: bug#76997: 31.0.50; Freplace_buffer_contents
Date: Fri, 14 Mar 2025 09:13:45 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: nat chapman <nat.chapman <at> proton.me>,  76997 <at> debbugs.gnu.org
> Date: Thu, 13 Mar 2025 16:54:27 -0400
> 
> >> under certain circumstances, Freplace_buffer_contents seems to introduce
> >> gibberish into the buffer. i noticed it in org-mode and followed it to
> >> Freplace_buffer_contents with debug, then confirmed with git bisect that
> >> commit 40d8650d517 introduced the problem.
> > Thanks, should be fixed now.
> > Stefan, would you please eyeball the fix?
> 
> Duh!  Can't believe I missed that.
> Thanks for the fix, looks good.

Thanks, I'm therefore closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Apr 2025 11:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 67 days ago.

Previous Next


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