GNU bug report logs - #46722
test-map-into fails

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 23 Feb 2021 16:23:01 UTC

Severity: normal

Merged with 53365

Found in versions 27.2, 28.0.50, 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>, "Basil
 L. Contovounesios" <contovob <at> tcd.ie>, dick.r.chiang <at> gmail.com,
 46722 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#46722: test-map-into fails
Date: Sat, 15 Jan 2022 10:16:48 -0500
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





This bug report was last modified 3 years and 123 days ago.

Previous Next


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