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#46722: test-map-into fails Date: Sat, 15 Jan 2022 10:16:48 -0500 Message-ID: References: <871r2yu8b1.fsf@gnus.org> <87czl7w4fh.fsf@dick> <87a6gawabq.fsf@dick> <83a6ga9hu1.fsf@gnu.org> <87pmouu5np.fsf@gnus.org> <8735lpo2ax.fsf@gnus.org> 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="30282"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Glenn Morris , Stefan Kangas , "Basil L. Contovounesios" , dick.r.chiang@gmail.com, 46722@debbugs.gnu.org, Lars Ingebrigtsen , Eli Zaretskii To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 15 16:17:34 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 1n8koA-0007cZ-EH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 16:17:34 +0100 Original-Received: from localhost ([::1]:47260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8ko8-0003Es-Tw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 10:17:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8knf-0003Ek-4h for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 10:17:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8kne-0007Ab-S0 for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 10:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8kne-0004hp-Fc for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 10:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jan 2022 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46722 X-GNU-PR-Package: emacs Original-Received: via spool by 46722-submit@debbugs.gnu.org id=B46722.164225981918075 (code B ref 46722); Sat, 15 Jan 2022 15:17:02 +0000 Original-Received: (at 46722) by debbugs.gnu.org; 15 Jan 2022 15:16:59 +0000 Original-Received: from localhost ([127.0.0.1]:41509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8knb-0004hT-H7 for submit@debbugs.gnu.org; Sat, 15 Jan 2022 10:16:59 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8knZ-0004hD-FS for 46722@debbugs.gnu.org; Sat, 15 Jan 2022 10:16:57 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AEC061001AC; Sat, 15 Jan 2022 10:16:51 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A8159100120; Sat, 15 Jan 2022 10:16:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1642259809; bh=Awb/z/L+Qiz94ALm1lFIhqXMrURuNHqD8t7LfxQCOFI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=bhIb3sn395dDUY7tIVSkM3bzjIUSYJ4tLc1SR48PrMBfQIBvmpa+iYy0esV8ujKq5 QoX7tGl9W/HlC/+E4N3oDrHxjMrTclNNP9nPjsMMLoz+QO/V5zxYtkIeEMEPUCmBAi 0SBLymZe/f24wUdAFX1TYNo5nEF1UyJYdX7cA9FI8Kx0O15kV3z0bbsROTq35nTW/x LJ06XBzUNqH2sn0dIKncHV86xD+1Syfr+8Wi0YsYUM6hhldP7RDg9CqvrU91JmzHgd oEV2cj1HfW8TJ4BPbLQcrg2+mC1QhgzDG6wmJBmioKs5IdAryyP1GDP+0wptDS04aW IPrhhFCut1aQw== Original-Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2EEC21201BB; Sat, 15 Jan 2022 10:16:49 -0500 (EST) In-Reply-To: (Philipp Stephani's message of "Sat, 15 Jan 2022 12:47:33 +0100") 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:224316 Archived-At: FWIW, I think installing the cl-generic patch into `emacs-28` would be a much better option. In my view it's "super safe" and it fixes a nasty bug that can affect a lot of code (as we're witnessing here with those test problems). It admittedly doesn't fix a regression. For reference the patch is just: diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 983694204df..5090e060372 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -604,7 +604,9 @@ cl--generic-dispatchers (defun cl--generic-get-dispatcher (dispatch) (with-memoization - (gethash dispatch cl--generic-dispatchers) + ;; We need `copy-sequence` here because this `dispatch' object might be + ;; modified by side-effect in `cl-generic-define-method' (bug#46722). + (gethash (copy-sequence dispatch) cl--generic-dispatchers) ;; (message "cl--generic-get-dispatcher (%S)" dispatch) (let* ((dispatch-arg (car dispatch)) (generalizers (cdr dispatch)) It's already the second time I say it, so I promise it's the last time I insist here. I can live with either choice, but I'm sure Emacs-28 will be better off with the patch than without. Stefan