Subject: Re: bug#75520: Circular code or data can hang Emacs unquittably

From: Pip Cet <[email-masked]>
Date: Sun, 12 Jan 2025 21:46:46 +0000

"Paul Eggert" <[email-masked]> writes:

> On 2025-01-12 10:43, Eli Zaretskii wrote:
>>> Date: Sun, 12 Jan 2025 17:08:24 +0000
>>> From:  Pip Cet via "Bug reports for GNU Emacs,
>
>>> There are similar issues with circular data: if Lisp code turns
>>> process-environment into a circular structure, for example, call_process
>>> will hang Emacs.  If this should be fixed, please let me know so I can
>>> create a separate bug report and look for similar issues.
>>
>> Thanks, let's hear what others (CC'ed) think about this.
>
> I'd like the process-environment bug fixed too. The bug should be easy
> to fix, and an unquittable Emacs is a real pain for all concerned.

This seems to be a common problem.  I did a quick git grep
'while.*CONSP':

definitely broken: debug-on-error, debug-ignored-errors,
unread-command-events, timer-list, the argument to Fkeymap_prompt

possibly broken: the 'error-conditions symbol property, image specs
(gtkutil.c checks valid_image_p, then runs Lisp, which might modify the
spec), buffer-undo-list (truncate_undo_list; please ensure ditty is
preserved), other functions in keymap.c.

git grep 'for.*CONSP' also returns many hits, which I haven't looked at
(it's also common to have the "for" keyword on a different line than the
CONSP, of course).

Pip