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: Wed, 05 Jan 2022 11:31:59 -0500 Message-ID: References: <871r2yu8b1.fsf@gnus.org> <87czl7w4fh.fsf@dick> <87a6gawabq.fsf@dick> 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="20765"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: contovob@tcd.ie, Glenn Morris , Lars Ingebrigtsen , Stefan Kangas , 46722@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 05 17:33:13 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 1n59Ds-0005Ce-RQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Jan 2022 17:33:13 +0100 Original-Received: from localhost ([::1]:57900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n59Dr-00043R-FQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Jan 2022 11:33:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n59Di-00042d-QW for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2022 11:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58284) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n59Di-00056L-HR for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2022 11:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n59Di-0002jT-4I for bug-gnu-emacs@gnu.org; Wed, 05 Jan 2022 11:33: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: Wed, 05 Jan 2022 16:33: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.164140033610440 (code B ref 46722); Wed, 05 Jan 2022 16:33:02 +0000 Original-Received: (at 46722) by debbugs.gnu.org; 5 Jan 2022 16:32:16 +0000 Original-Received: from localhost ([127.0.0.1]:41597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n59Cx-0002iK-OJ for submit@debbugs.gnu.org; Wed, 05 Jan 2022 11:32:16 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n59Cv-0002i0-V6 for 46722@debbugs.gnu.org; Wed, 05 Jan 2022 11:32:14 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4A25510028A; Wed, 5 Jan 2022 11:32:08 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CE62A10013B; Wed, 5 Jan 2022 11:32:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1641400326; bh=fb8QXy+CZkhKm++bYzjARCeWdls9kcHvZfSbzcaw1M4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=f5sGxrd2c5/poEwTLjigjVdP6NC9SNAYxSE4EZmNnz+XFZtdf0zgaB53ikSUi6ZjX Gex7kS996N+ap+YqBqsS+ZW3TNl+WN/0qW/gPPjg5G1DrlGJYPDjy+yUrdqn9b/tUS CqOv8HczUeOjzRuJ6B7k3ukoGc0+9NCnS4Z0PYgY//s0G4OJ2WxtH/UXDz/07izNey +c7BruQ8kJi+/UaMWhzFQ5tZRAp+I3w2UU1GwBgyJRFWmtIjyvcGXIV8B70p9ADAE3 Znm513UBcnZAJnTvAB9a8f7sfDYYcwBB3TMNAqoR0vJYep/OFgQGmYJ7hftI9n8/l2 kJNez8LPXEEJQ== Original-Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 890E212019C; Wed, 5 Jan 2022 11:32:06 -0500 (EST) In-Reply-To: <87a6gawabq.fsf@dick> (dick's message of "Wed, 05 Jan 2022 09:01:29 -0500") 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:223700 Archived-At: Hi Dick, dick [2022-01-05 09:01:29] wrote: > For unclear reasons, the hash-table `cl--generic-dispatchers` keyed off > raw, unburnished defstructs returns values for non-existent keys. Hmm... I don't understand what this means concretely. I'm aware that `cl--generic-dispatchers` can be fiddly (IIRC because there can be functions in the key), but I still can't figure out what scenario you're describing nor how it can happen to return values for non-existent keys. Could you say a bit more, ideally with something like a trace or a test case? [...time passes...] > I normalized its key to a signature string, and, > > for i in {1..300} ; do src/emacs -Q -batch -f batch-byte-compile foo.el > ; src/emacs -Q -batch -l foo.elc ; done ; Oh I think I see what you mean. I can now reproduce the problem locally as well, and with the foo.el below I get two different traces: (trace-function 'cl--generic-get-dispatcher) (require 'map) (condition-case nil (progn (map-into nil '(hash-table)) (with-current-buffer "*trace-output*" (write-region nil nil "~/tmp/trace-good.eld"))) (error (with-current-buffer "*trace-output*" (write-region nil nil "~/tmp/trace-bad.eld") (message "ERROR!!")))) the two backtraces only differ on the last line. The good trace (slightly cleaned up for legibility) ends with: ====================================================================== 1 -> (cl--generic-get-dispatcher (1 #s(cl--generic-generalizer cl--generic-eql-generalizer 100 #[385 "" [gethash (cl--generic-eql-used)] 5] #[385 "" [eql] 4]) #s(cl--generic-generalizer cl--generic-t-generalizer 0 #[385 #2="\300\207" [nil] 3 #1#] #[385 #2# [(t)] 3]))) 1 <- cl--generic-get-dispatcher: #[771 "" [make-hash-table :test eql make-closure #[642 "" [V0 V1 V2 V3 cl--generic-eql-used apply gethash cl--generic-cache-miss 1 append #[385 "" [eql] 4] #[385 "\300\207" [(t)] 3] nil puthash] 15]] 10] ====================================================================== 1 -> (cl--generic-get-dispatcher (1 #s(cl--generic-generalizer cl--generic-eql-generalizer 100 #[385 "" [gethash (cl--generic-eql-used)] 5] #[385 "" [eql] 4]) #s(cl--generic-generalizer cl--generic-head-generalizer 80 #[385 "" [gethash car-safe (cl--generic-head-used)] 5] #[385 "" [head] 4]) #s(cl--generic-generalizer cl--generic-t-generalizer 0 #[385 #3="\300\207" [nil] 3] #[385 #3# [(t)] 3]))) 1 <- cl--generic-get-dispatcher: #[771 "" [make-hash-table :test eql make-closure #[642 "" [V0 V1 V2 V3 cl--generic-eql-used cl--generic-head-used apply gethash cl--generic-cache-miss 1 append #[385 "" [eql] 4] #[385 "" [head] 4] #[385 "\300\207" [(t)] 3] nil puthash] 16]] 10] whereas in the bad trace, the last returned value is identical to the previous one (i.e. somehow the `head` dispatcher is absent from the returned function). Hmm.... Stefan