From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#46722: test-map-into fails Date: Tue, 23 Feb 2021 20:58:52 +0000 Message-ID: <87blcaqz5f.fsf@tcd.ie> References: <87pn0qu4k9.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3279"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46722@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 23 22:00:27 2021 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 1lEenD-0000mN-9v for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Feb 2021 22:00:27 +0100 Original-Received: from localhost ([::1]:40012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEenC-0006BR-Bw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Feb 2021 16:00:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEemr-0006BA-ST for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2021 16:00:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEemo-0001kl-Ao for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2021 16:00:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEemo-000085-85 for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2021 16:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Feb 2021 21:00: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.1614113971433 (code B ref 46722); Tue, 23 Feb 2021 21:00:02 +0000 Original-Received: (at 46722) by debbugs.gnu.org; 23 Feb 2021 20:59:31 +0000 Original-Received: from localhost ([127.0.0.1]:60746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEemI-00006v-La for submit@debbugs.gnu.org; Tue, 23 Feb 2021 15:59:30 -0500 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:52176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEemH-00006i-4A for 46722@debbugs.gnu.org; Tue, 23 Feb 2021 15:59:29 -0500 Original-Received: by mail-wm1-f45.google.com with SMTP id j187so21393wmj.1 for <46722@debbugs.gnu.org>; Tue, 23 Feb 2021 12:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZyCMnQxwishCXLCGDYFdA663cUUwht1gXia6kvX7hKM=; b=al5d47sf3dIswCypu8ZKAryhnfofurOSbGsrGWAU+4jedmuCHR+fJLuDDBZ0doM/sJ ImGbJw21RAtEg0JaUlRlwo+jWvW+2tk5aqIQh7uNxSOHC7RE5R3ka1zkAMsNkbNZLF1n rwq+A4LC5BEjWgX6BIK6JwUeaH3tT5f08ACMUXw+w34WbAMq1lucGXwgW6M4GDBsCWkD lECNuu1sFAsxigeDlrVKXvRiA4eu2++x1llfjtxI79ngR82B1D1uwwyDSo04/zEPyHhJ uSFghrEdISekl9EJS0hVHSd8rbhn9nJGwkMttutUt/p3PwOCA/X7IOcKyOdUl2r1Rubq B0Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZyCMnQxwishCXLCGDYFdA663cUUwht1gXia6kvX7hKM=; b=X4uSL0z2WUznM12YGwnh+YvTFiciMVhCLP4WijIRx1reuEgVvZklUH26ANKaC6qpSV gAhmLPKcWZzYtDZ7TBPp47DyeJCoOG3Wo4WXFsXZXa8iMr3+RCqkLLPDeKf8sOCOg8ms UnxlzQfw85IcLMmq3H1zy2ieM69v18sYBHRJ5BA+aHvgZNroxqaM03xq7wj2d3VLF/LI GMtV95UPH72eOBAdASEQkvVHKg2MJJ4m5y23ecu4z542oHrWvm/80eDd7CkTLO7ISTTG RlXKQ/6OcvmugI8FJMYXhfRV+y9TbKKPpJT2GDTA+xAoIp1sc8O700n+e/3MmKxShXOx kC/g== X-Gm-Message-State: AOAM5322RdAZa7x8l+ydalypnVvLX0elWS0eCmMW7zzLcsDPKXBp6Zym CBiQWWNzcb3NuUTGeWhmYuzyJ3iVcHmwqQ== X-Google-Smtp-Source: ABdhPJyTRHVQooMM2YlMpFDbvGp0E2EuWGBA+nJs5u84czAXScTo8+PX7S2/YyJZ/qkVU5AKbveWWA== X-Received: by 2002:a1c:c906:: with SMTP id f6mr555710wmb.128.1614113963164; Tue, 23 Feb 2021 12:59:23 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id 4sm4415772wma.0.2021.02.23.12.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 12:59:05 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 23 Feb 2021 12:30:12 -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:200684 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: > This kind of code is supposed to be fully deterministic, so it's quite > worrisome. It sounds/smells like memory corruption or some other bug in > the memory management. > > If you could come up with a reasonably simple code (in the sense that it > doesn't take too long to run) to reproduce this problem with a high > probability, maybe we can start adding some tracing to try and figure > out what's going on. > > IOW, try and write a loop that runs the problematic code a couple > hundred times, so that one of those should fail. Then try and cut down > the code as much as possible, verifying along the way that the problem > didn't disappear. Here's the simplest repro I could find: ;;; foo.el -*- lexical-binding: t -*- (require 'map) (map-into () '(hash-table)) ;;; foo.el ends here followed by: emacs -Q -batch -f batch-byte-compile foo.el while emacs -Q -batch -l foo.elc; do :; done which barfs the attached after a few seconds. The same happens with: (map-into () '(hash-table :test eq)) (map-into () '(hash-table :test eql)) (map-into () '(hash-table :test equal)) but not with: (map-into () 'hash-table) so maybe the heisenbug lies with cl-defmethod's treatment of 'head'? Let me know if you'd like me to run anything else. Thanks, -- Basil --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=backtrace.el Content-Transfer-Encoding: quoted-printable Debugger entered--Lisp error: (cl-no-applicable-method map-into nil (hash-t= able)) signal(cl-no-applicable-method (map-into nil (hash-table))) cl-no-applicable-method(#s(cl--generic :name map-into :dispatches ((1 #s(= cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :ta= gcode-function #f(compiled-function (name &rest _) #) :specializers-function #f(compiled-function (tag &rest _) #)) #s(cl--generic-generalizer :name cl--generic-head-= generalizer :priority 80 :tagcode-function #f(compiled-function (name &rest= _) #) :specializers-function #f(compiled-funct= ion (tag &rest _) #)) #s(cl--generic-generaliz= er :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compile= d-function (name &rest _) #) :specializers-fu= nction #f(compiled-function (tag &rest _) #)))= (0 #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 = :tagcode-function #f(compiled-function (name &rest _) #) :specializers-function #f(compiled-function (tag &rest _) #)))) :method-table (#s(cl--generic-method :special= izers (t (head hash-table)) :qualifiers nil :uses-cnm nil :function #f(comp= iled-function (map type) "Convert MAP into a hash-table.\nTYPE is a list wh= ere the car is `hash-table' and the cdr are the\nkeyword-args forwarded to = `make-hash-table'.\n\nExample:\n (map-into '((1 . 3)) '(hash-table :test= eql))" #)) #s(cl--generic-method :specializers= (t (eql hash-table)) :qualifiers nil :uses-cnm nil :function #f(compiled-f= unction (map type) "Convert MAP into a hash-table." #)) #s(cl--generic-method :specializers (t (eql plist)) :qualifiers n= il :uses-cnm nil :function #f(compiled-function (map type) #)) #s(cl--generic-method :specializers (t (eql alist)) :qualif= iers nil :uses-cnm nil :function #f(compiled-function (map type) #)) #s(cl--generic-method :specializers (t (eql list)) := qualifiers nil :uses-cnm nil :function #f(compiled-function (map type) #))) :options nil) nil (hash-table)) apply(cl-no-applicable-method #s(cl--generic :name map-into :dispatches (= (1 #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 1= 00 :tagcode-function #f(compiled-function (name &rest _) #) :specializers-function #f(compiled-function (tag &rest _) #<= bytecode -0xc2b468c2856371a>)) #s(cl--generic-generalizer :name cl--generic= -head-generalizer :priority 80 :tagcode-function #f(compiled-function (name= &rest _) #) :specializers-function #f(compiled= -function (tag &rest _) #)) #s(cl--generic-gen= eralizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(c= ompiled-function (name &rest _) #) :specializ= ers-function #f(compiled-function (tag &rest _) #))) (0 #s(cl--generic-generalizer :name cl--generic-t-generalizer :prior= ity 0 :tagcode-function #f(compiled-function (name &rest _) #) :specializers-function #f(compiled-function (tag &rest _)= #)))) :method-table (#s(cl--generic-method :s= pecializers (t (head hash-table)) :qualifiers nil :uses-cnm nil :function #= f(compiled-function (map type) "Convert MAP into a hash-table.\nTYPE is a l= ist where the car is `hash-table' and the cdr are the\nkeyword-args forward= ed to `make-hash-table'.\n\nExample:\n (map-into '((1 . 3)) '(hash-table= :test eql))" #)) #s(cl--generic-method :specia= lizers (t (eql hash-table)) :qualifiers nil :uses-cnm nil :function #f(comp= iled-function (map type) "Convert MAP into a hash-table." #)) #s(cl--generic-method :specializers (t (eql plist)) :qualif= iers nil :uses-cnm nil :function #f(compiled-function (map type) #)) #s(cl--generic-method :specializers (t (eql alist)) := qualifiers nil :uses-cnm nil :function #f(compiled-function (map type) #)) #s(cl--generic-method :specializers (t (eql li= st)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (map type= ) #))) :options nil) (nil (hash-table))) #f(compiled-function (&rest args) #)(nil (ha= sh-table)) apply(#f(compiled-function (&rest args) #) n= il (hash-table) nil) map-into(nil (hash-table)) byte-code("\300\301!\210\302\303\304\"\207" [require map map-into nil (ha= sh-table)] 3) load("/tmp/foo.elc" nil t) command-line-1(("-l" "foo.elc")) command-line() normal-top-level() --=-=-=--