Subject: bug#79200: 31.0.50; Duplicated elements for '#<marker at' in buffer-undo-list

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Aug 2025 12:18:03 +0300

> Date: Fri, 08 Aug 2025 18:43:51 +0200
> From:  Óscar Fuentes via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> emacs -Q
> 
> write in *scratch* some lines with random words:
> 
> arins
> arseina
> aierni
> 
> iosrn nioni
> ionugfw
> 
> sronuf
> 
> Now undo a few of those lines (C-_), move the cursor and C-_ again to
> redo.
> 
> C-h v buffer-undo-list
> 
> shows a content like this:
> 
> (nil (#("sreint" 0 6 (fontified t)) . 164)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6)
>      (#<marker at 164 in *scratch*> . -6) nil (#("
> "
> 						 0 1 (fontified t))
> 					       . 170)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker in no buffer> . -1) nil
>      (#("aor" 0 3 (fontified t)) . 171)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3)
>      (#<marker at 164 in *scratch*> . -3) nil (#("
> "
> 						 0 1 (fontified t))
> 					       . 174)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
>      (#<marker at 164 in *scratch*> . -1)
> etc.
> 
> On a long-lived session, those elements are so abundant and they are
> added so fast that exhaust the capacity for undo info. On certain
> circunstances, while undoing, "No further undo information" is shown
> after just four undos affecting a few lines each.
> 
> On those sessions, eventually, a warning like this is displayed:
> 
>   Warning (undo): Buffer ‘blah.el’ undo info was 36040665 bytes long.
>   The undo info was discarded because it exceeded `undo-outer-limit'.

Your bug report says this is on master branch:

> In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
>  version 1.18.4) of 2025-08-08 built on zen
> Repository revision: 12354bcfdc288f111c411c87e8bdebe6dcb41a4d
> Repository branch: master

But I can only reproduce this on the igc branch.  On master, I see a
single entry for marker adjustment, not many identical ones.