Subject: bug#79308: 30.2; Maximum buffer size exceeded when running package-list-packages

From: Enrico Rivarola <[email-masked]>
Date: Wed, 27 Aug 2025 10:01:39 +0200

Thanks for response,
I tried recompiling Emacs, but I still have the problem.
Maybe the problem is related to something on my system, but I don't know.
For now, I've solved it by setting 'custom-file' to a 'real' file (e.g "my-custom.el" in 
'user-emacs-directory').
I found two messages that refer to the same problem on 'help-gnu-emacs' archive for the Emacs 30 
series:
* "Maximum buffer size exceeded when running package-list-packages"
   https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00343.html
* "Maximum buffer size message on Emacs 30.1"
   https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00187.html

in my case I created a testing script to reproduce the problem, at least on my system:

######################################################################
#!/bin/bash -e

rm -rf ~/emacs-tmp
mkdir ~/emacs-tmp
cat <<EOF > ~/emacs-tmp/init.el
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq custom-file null-device)
(package-install 'git-gutter)
EOF

emacs --init-directory=~/emacs-tmp --eval "(package-list-packages)"
######################################################################

'git-gutter' is one of my installed package but I don't think it's important for testing, what's 
needed for testing purposes is to install some packages.

Thanks
Enrico

Il 26/08/25 21:39, Jeremy Bryant ha scritto:
> Eli Zaretskii <[email-masked]> writes:
> 
>>> Date: Mon, 25 Aug 2025 11:40:24 +0200
>>> From:  Enrico Rivarola via "Bug reports for GNU Emacs,
>>>   the Swiss army knife of text editors" <[email-masked]>
>>>
>>> Hi,
>>> after upgrading to Emacs 30.2 I've this error message when running the 'package-list-packages'
>>> command:
>>>
>>> "find-file-noselect-1: Maximum buffer size exceeded"
>>>
>>> Running the command more times seems to make the message disappear, but doing some tests I found
>>> that the cause of the problem, at least in my system, seems to be the configuration of
>>> "custom-file' to 'null-device'.
>>> Leaving it at its default value or setting it to a different real file (e.g. 'my-custom.el' in
>>> 'user-emacs-directory') does not cause any errors.
>>
>> I cannot reproduce this.  I started Emacs, the typed
>>
>>    M-: (setq custom-file null-device) RET
>>
>> then typed
>>
>>    M-x package-list-packages RET
>>
>> and Emacs displayed the list of packages without any error message.
>>
>> Can anyone else reproduce this problem?
> 
> FWIW I was no able to reproduce this bug on emacs -Q
>