From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58601: 29.0.50; Infinite loop in byte-compile--first-symbol-with-pos Date: Wed, 19 Oct 2022 08:48:27 -0400 Message-ID: References: <8735bm6nl9.fsf@tcd.ie> <87pmepw0ov.fsf@tcd.ie> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35034"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "Basil L. Contovounesios" , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 58601@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 19 14:50:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol8Wh-0008tR-GG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 14:50:27 +0200 Original-Received: from localhost ([::1]:57252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol8Wf-0003kf-Qy for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 08:50:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol8VL-0003hl-6n for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 08:49:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ol8VJ-0001ce-Sh for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 08:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ol8VJ-00086n-NW for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 08:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2022 12:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58601 X-GNU-PR-Package: emacs Original-Received: via spool by 58601-submit@debbugs.gnu.org id=B58601.166618372031137 (code B ref 58601); Wed, 19 Oct 2022 12:49:01 +0000 Original-Received: (at 58601) by debbugs.gnu.org; 19 Oct 2022 12:48:40 +0000 Original-Received: from localhost ([127.0.0.1]:56152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol8Ux-000869-RZ for submit@debbugs.gnu.org; Wed, 19 Oct 2022 08:48:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol8Uw-00085w-9W for 58601@debbugs.gnu.org; Wed, 19 Oct 2022 08:48:38 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0C67180CCE; Wed, 19 Oct 2022 08:48:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 626EE805B2; Wed, 19 Oct 2022 08:48:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666183710; bh=rx3zX5ngX7bLVdF/e9Mv6cB46DxMVb0LwTS3fiy5DI0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WRVi/faH1rZ/W6h3z7Z07A8xjJhx2POYXAQMsn8DdrfAZHt9pA48O3ofFY31kmnk1 7F4YfRqH6N6dmEeuKe69320Z3VeyCTVY+RtLaTE90OhZqBnZlMWB7o0+ZKaSKW4jJc BQISyg7liSX0sUqa01NxhqrXRTsrgJFqaYJPhTLP97PlGIW+QNJNaAd0G4htn+r69f P11V3WL1Tw5oNzRvF1cqOkMkt9+R2D5OulsA6xXzeF+bdsgjafWZf7cbChMIl5pgPS Y8vgbL6MMtdaYamiZ5+yC89/tjVbFPm5fJ9AUGxpuH+DRdTT6djvS9lwfTvIha+jX3 7a1i9QvYetkjA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 03C2F12046D; Wed, 19 Oct 2022 08:48:29 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Wed, 19 Oct 2022 08:52:10 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245870 Archived-At: >> 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