GNU bug report logs - #58601
29.0.50; Infinite loop in byte-compile--first-symbol-with-pos

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Mon, 17 Oct 2022 23:25:01 UTC

Severity: normal

Found in version 29.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>,
 Mattias EngdegÄrd <mattiase <at> acm.org>,
 58601 <at> debbugs.gnu.org
Subject: Re: bug#58601: 29.0.50; Infinite loop in
 byte-compile--first-symbol-with-pos
Date: Wed, 19 Oct 2022 08:48:27 -0400
>> where `somefun` does *not* come from the source but from the
>> compiler-macro instead and hence doesn't have any sympos, and then
>> `somearg1` was an expression of the form
>
>>    (quote #1=(1 2 3 . #1#))
>
>> So, there was no cycle in the code part, the cycle is only inside the
>> data embedded in the code.
>
> I think somebody who writes something like that _deserves_ to go into an
> infinite loop.

Circular data is not very frequent, but it's not rare either (as you
found out during the development of sympos, as evidenced by
`byte-run--ssp-seen`).

`byte-compile--first-symbol-with-pos` didn't bump into it until now
simply because it usually gets "lucky" and finds a sympos before getting
to a cyclic embedded data.

> Have you ever seen anything at all like this in real life?

Of course, and so have you :-)

> You have fixed this "problem" by arbitrarily limiting the size of
> valid form stacks that can be searched, and the depth to which they
> can be searched.  This limit, 10, seems too small.  There can easily
> be form stacks with more than 10 elements.  Do you have any objection
> if I change that 10 to something closer to infinity?

Be my guest.

> Something which will encompass any form stack likely to be
> encountered in practice?  I would suggest the number 300.

Fine by me.  Tho once we get into this range, 666 sounds a lot
more enticing. :-)


        Stefan





This bug report was last modified 2 years and 300 days ago.

Previous Next


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