From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function Date: Thu, 3 Aug 2023 16:11:30 +0000 Message-ID: References: <8B08E514-B2D5-48F5-BA90-4F5A9492F8F9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2059"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65017@debbugs.gnu.org, Stefan Monnier , Eric Marsden To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 03 18:12:22 2023 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 1qRavy-000Ad7-3k for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Aug 2023 18:12:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRavl-00007K-P4; Thu, 03 Aug 2023 12:12:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRavi-000074-Hk for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 12:12:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRavi-00053Q-6U for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRavh-0001qJ-P5 for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 12:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Aug 2023 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65017 X-GNU-PR-Package: emacs Original-Received: via spool by 65017-submit@debbugs.gnu.org id=B65017.16910791027052 (code B ref 65017); Thu, 03 Aug 2023 16:12:01 +0000 Original-Received: (at 65017) by debbugs.gnu.org; 3 Aug 2023 16:11:42 +0000 Original-Received: from localhost ([127.0.0.1]:52794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRavO-0001pg-4X for submit@debbugs.gnu.org; Thu, 03 Aug 2023 12:11:42 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:17348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRavL-0001pQ-MM for 65017@debbugs.gnu.org; Thu, 03 Aug 2023 12:11:40 -0400 Original-Received: (qmail 88643 invoked by uid 3782); 3 Aug 2023 18:11:31 +0200 Original-Received: from acm.muc.de (p4fe157c8.dip0.t-ipconnect.de [79.225.87.200]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 03 Aug 2023 18:11:31 +0200 Original-Received: (qmail 23796 invoked by uid 1000); 3 Aug 2023 16:11:30 -0000 Content-Disposition: inline In-Reply-To: <8B08E514-B2D5-48F5-BA90-4F5A9492F8F9@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266601 Archived-At: Hello, Mattias, and Stefan. On Thu, Aug 03, 2023 at 11:39:33 +0200, Mattias Engdegård wrote: > > Error: invalid-function (#) > That is a symbol-with-position somehow leaking out. > We can simplify your nice little test case to > ------- first file ----------- > (require 'cl-macs) > (defun zeta () (cl-flet () #'equal)) > ------- second file --------- > (defun eta () (cl-flet () (funcall #'equal 12 34))) > ------------------------------ > and indeed, the leak is in cl--labels-convert-cache which will contain `equal` as a symbol-with-pos after byte-compiling the first file, and this causes trouble in the second file. > cl--labels-convert-cache contains > (# function #) > and the function `eta` is consequently defined as > (closure (t) nil (progn (# 12 34))) > where 49 is the position of `equal` in the first file. First thoughts: It would seem cl--labels-convert-cache is failing to get initialised, somewhere. Perhaps this is a problem of cache invalidation. The variable lacks a doc-string, which might otherwise have documented where it is meant to be valid. What does this variable mean? cl--label-convert is defined as "Special macro-expander to rename (function F) references in `cl-labels'.". What does "rename (function F) references" mean? Is the term "name" in this context defined anywhere? > Stefan and Alan should have a word here but I doubt we should hack > this in cl-macs.el somehow, should we? If that's where the bug is, that's what we should fix. > Making Ffuncall (etc) tolerant of symbol-with-pos isn't appealing > either. Definitely not! -- Alan Mackenzie (Nuremberg, Germany).