GNU bug report logs - #32503
26.1; Byte-compiled functions don't hash consistently

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Adam Porter <adam@HIDDEN>; merged with #38912; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 38912 <at> debbugs.gnu.org and NiwTinray <niwtrx@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 32503 <at> debbugs.gnu.org:


Received: (at 32503) by debbugs.gnu.org; 28 Apr 2022 11:41:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 28 07:41:19 2022
Received: from localhost ([127.0.0.1]:45630 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nk2WM-0001jL-TM
	for submit <at> debbugs.gnu.org; Thu, 28 Apr 2022 07:41:19 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53778)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1nk2WK-0001iz-FK; Thu, 28 Apr 2022 07:41:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=SRBV3gJ5PGbVRRKBovBGSWJWnFHVyPaJ076HFgPFTg8=; b=o6Y/Nc9mVYx5ynhmDisb+5rziT
 ffZtuDtMILrHPZt5zebJtE+tfI1oHzWnD958VaAY/crdSgLaIJaiUaEKxJ8sWvUcUgwACPCXmzVHe
 oVvckrIRh6M2aGb2NfeSRzD9wXz2SKC1jsgOAkpz8wXXR8b47FyCbFdxcSopB19BQbBo=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nk2W6-0000I4-Os; Thu, 28 Apr 2022 13:41:05 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#38912: 27.0.60; PDumper meets segmentation fault when evil
 is loaded
References: <333553AC-68DE-4F1C-9586-5A13248AD6DD@HIDDEN>
 <83ftgvh96l.fsf@HIDDEN>
 <D1473DD8-48F8-4204-80B5-BE6396B8B668@HIDDEN>
 <83a771g2tc.fsf@HIDDEN>
 <dcca1c92a8d6d60393a7e6c0f4742be5.squirrel@HIDDEN>
 <83zhcvuvc1.fsf@HIDDEN>
 <a0187a0bba510f62e6ba06bc30495983.squirrel@HIDDEN>
 <83eeu2b43p.fsf@HIDDEN> <87h7hngr8d.fsf_-_@HIDDEN>
X-Now-Playing: Coldcut's _This Is Fascism (1)_: "This Is Fascism (Angry
 Ninja Mix)"
Date: Thu, 28 Apr 2022 13:41:02 +0200
In-Reply-To: <87h7hngr8d.fsf_-_@HIDDEN> (Lars Ingebrigtsen's message of
 "Thu, 24 Jun 2021 18:30:26 +0200")
Message-ID: <87sfpxl9kh.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Lars Ingebrigtsen <larsi@HIDDEN> writes: >> I noticed that
 byte-compiled functions don't hash consistently. Here's >> an ECM from Noam
 Postavsky >>
 <https://github.com/skeeto/emacs-memoize/pull/10#issuecomment-415066682>:
 >> >> (let ((obj1 ( [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 32503
Cc: 32503 <at> debbugs.gnu.org, niwtrx@HIDDEN,
 Daniel Colascione <dancol@HIDDEN>, Adam Porter <adam@HIDDEN>,
 38912 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

>> I noticed that byte-compiled functions don't hash consistently.  Here's
>> an ECM from Noam Postavsky
>> <https://github.com/skeeto/emacs-memoize/pull/10#issuecomment-415066682>:
>>
>>     (let ((obj1 (byte-compile (lambda (x) x)))
>>           (obj2 (byte-compile (lambda (x) x))))
>>       (list (equal obj1 obj2)
>>             (eq obj1 obj2)
>>             (= (sxhash obj1)
>>                (sxhash obj2))))
>>     ;=> (t nil nil)
>
> And this test case no longer fails in Emacs 28 (but it fails in Emacs
> 27).  So is there more to be done in these merged bug reports?

There wasn't any response in 43 weeks, so it seems like the issue has
been fixed for Emacs 28, and I'm therefore closing it.  If there are
other problems in this area, I think it would be better to open a new
bug report for those problems.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32503; Package emacs. Full text available.

Message received at 32503 <at> debbugs.gnu.org:


Received: (at 32503) by debbugs.gnu.org; 24 Jun 2021 16:30:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 24 12:30:45 2021
Received: from localhost ([127.0.0.1]:43982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lwSFZ-0003Z2-69
	for submit <at> debbugs.gnu.org; Thu, 24 Jun 2021 12:30:45 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33968)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1lwSFW-0003RX-Vd; Thu, 24 Jun 2021 12:30:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=RX78u0heOTPS0Pebb3M9KRCZ81hS9UvGY9m5Okq9h88=; b=Nxs50OJ0VLG7b49bIWnZpY1AX8
 xkrJCfZYCfTeG7Yv9Jpht46mMRDeKs8Ie/+La2B94lznahXis31dfes41K4SozPT84k+MNJDj2+j3
 iYE9lUe0z1vmaHT87TVUQnSVSUixMerRVuiR16/MJnYI5QfsUeprwpxlNW4nweyquD2A=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lwSFH-0002PD-BC; Thu, 24 Jun 2021 18:30:30 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#32503: 26.1; Byte-compiled functions don't hash consistently
References: <333553AC-68DE-4F1C-9586-5A13248AD6DD@HIDDEN>
 <83ftgvh96l.fsf@HIDDEN>
 <D1473DD8-48F8-4204-80B5-BE6396B8B668@HIDDEN>
 <83a771g2tc.fsf@HIDDEN>
 <dcca1c92a8d6d60393a7e6c0f4742be5.squirrel@HIDDEN>
 <83zhcvuvc1.fsf@HIDDEN>
 <a0187a0bba510f62e6ba06bc30495983.squirrel@HIDDEN>
 <83eeu2b43p.fsf@HIDDEN>
X-Now-Playing: Fingerprintz's _Methods of Dance (1)_: "The Beat Escape"
Date: Thu, 24 Jun 2021 18:30:26 +0200
In-Reply-To: <83eeu2b43p.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 09 Mar
 2020 05:26:50 +0200")
Message-ID: <87h7hngr8d.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Eli Zaretskii <eliz@HIDDEN> writes: >> Sorry, haven't had
 a chance to look at it yet. I've been treating it as >> low-ish priority
 because pdumping outside loadup isn't supported yet. Is >> there some reason
 to expedite this work? > > N [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 32503
Cc: 32503 <at> debbugs.gnu.org, niwtrx@HIDDEN,
 Daniel Colascione <dancol@HIDDEN>, Adam Porter <adam@HIDDEN>,
 38912 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Sorry, haven't had a chance to look at it yet. I've been treating it as
>> low-ish priority because pdumping outside loadup isn't supported yet. Is
>> there some reason to expedite this work?
>
> Not that I can see, no.  I just wanted to be sure this isn't
> forgotten.
>
> Thanks.

This was a long thread, and I only skimmed it lightly.  But I noticed
that it was merged with this bug report:

Adam Porter <adam@HIDDEN> writes:

> I noticed that byte-compiled functions don't hash consistently.  Here's
> an ECM from Noam Postavsky
> <https://github.com/skeeto/emacs-memoize/pull/10#issuecomment-415066682>:
>
>     (let ((obj1 (byte-compile (lambda (x) x)))
>           (obj2 (byte-compile (lambda (x) x))))
>       (list (equal obj1 obj2)
>             (eq obj1 obj2)
>             (= (sxhash obj1)
>                (sxhash obj2))))
>     ;=> (t nil nil)

And this test case no longer fails in Emacs 28 (but it fails in Emacs
27).  So is there more to be done in these merged bug reports?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32503; Package emacs. Full text available.
Merged 32503 38912. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 32503 <at> debbugs.gnu.org:


Received: (at 32503) by debbugs.gnu.org; 23 Aug 2018 01:42:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 22 21:42:50 2018
Received: from localhost ([127.0.0.1]:58188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fseeA-0006AD-DK
	for submit <at> debbugs.gnu.org; Wed, 22 Aug 2018 21:42:50 -0400
Received: from gateway23.websitewelcome.com ([192.185.50.107]:32970)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tom@HIDDEN>) id 1fsee6-00069z-7l
 for 32503 <at> debbugs.gnu.org; Wed, 22 Aug 2018 21:42:47 -0400
Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20])
 by gateway23.websitewelcome.com (Postfix) with ESMTP id 909F711422
 for <32503 <at> debbugs.gnu.org>; Wed, 22 Aug 2018 20:42:45 -0500 (CDT)
Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP
 id sedZfZErePvAdsedsfXla2; Wed, 22 Aug 2018 20:42:44 -0500
X-Authority-Reason: nr=8
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=wBBpCaoFLTboBzfC9stHiAcSuI1X9wf7hzJ62oG2PmI=; b=nTvXjaSCHmXSiEOS4WSSsvPv7L
 cqBGlQQT8aK23O0TuZucQf8gDVIBA/kXzX9gRaUytTlBjs7mvozPcO9x6VGZKHu5bujYKm4OQTzrk
 M11Aa36GUOzSB3ZwCgY0q8PRk;
Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:42144 helo=bapiya)
 by box5379.bluehost.com with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91)
 (envelope-from <tom@HIDDEN>)
 id 1fsedZ-003ABT-LN; Wed, 22 Aug 2018 20:42:13 -0500
From: Tom Tromey <tom@HIDDEN>
To: Adam Porter <adam@HIDDEN>
Subject: Re: bug#32503: 26.1; Byte-compiled functions don't hash consistently
References: <CAO_b3FV+BOeguJU+UFpfo6VnrJ9Q5ympyeX61RHaKQhtcyhfug@HIDDEN>
X-Attribution: Tom
Date: Wed, 22 Aug 2018 19:42:12 -0600
In-Reply-To: <CAO_b3FV+BOeguJU+UFpfo6VnrJ9Q5ympyeX61RHaKQhtcyhfug@HIDDEN>
 (Adam Porter's message of "Wed, 22 Aug 2018 14:00:28 -0500")
Message-ID: <87efep3ll7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - box5379.bluehost.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - tromey.com
X-BWhitelist: no
X-Source-IP: 75.166.85.72
X-Source-L: No
X-Exim-ID: 1fsedZ-003ABT-LN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: 75-166-85-72.hlrn.qwest.net (bapiya) [75.166.85.72]:42144
X-Source-Auth: tom+tromey.com
X-Email-Count: 2
X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20=
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32503
Cc: 32503 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Adam> I noticed that byte-compiled functions don't hash consistently.

The Lisp_Vectorlike case in Fequal has a number of special cases which
don't seem to be reflected in sxhash:

	if (OVERLAYP (o1))
[...]
	if (MARKERP (o1))
[...]
	if (WINDOW_CONFIGURATIONP (o1))
[...]
	/* Aside from them, only true vectors, char-tables, compiled
	   functions, and fonts (font-spec, font-entity, font-object)
	   are sensible to compare, so eliminate the others now.  */

(Bignums and bool vectors are special-cased as well but are handled in
sxhash.)  This is followed by code to loop over the pseudovector's
elements.

However, the Lisp_Vectorlike case in sxhash doesn't do any of this.

Probably there should be a rule that adding a new type should
necessitate adding a new hasher (much like how print syntax is needed);
or certainly if the type has non-trivial equal behavior.

Tom




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#32503; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Aug 2018 19:00:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 22 15:00:56 2018
Received: from localhost ([127.0.0.1]:57984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fsYND-0001dH-Mx
	for submit <at> debbugs.gnu.org; Wed, 22 Aug 2018 15:00:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50612)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alphadeltapapa@HIDDEN>) id 1fsYNC-0001d1-Cs
 for submit <at> debbugs.gnu.org; Wed, 22 Aug 2018 15:00:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alphadeltapapa@HIDDEN>) id 1fsYN5-0003hZ-6H
 for submit <at> debbugs.gnu.org; Wed, 22 Aug 2018 15:00:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39270)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <alphadeltapapa@HIDDEN>)
 id 1fsYN4-0003hF-57
 for submit <at> debbugs.gnu.org; Wed, 22 Aug 2018 15:00:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43358)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <alphadeltapapa@HIDDEN>) id 1fsYN3-0007uA-AZ
 for bug-gnu-emacs@HIDDEN; Wed, 22 Aug 2018 15:00:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alphadeltapapa@HIDDEN>) id 1fsYMz-0003eF-K5
 for bug-gnu-emacs@HIDDEN; Wed, 22 Aug 2018 15:00:45 -0400
Received: from mail-ed1-f50.google.com ([209.85.208.50]:38603)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <alphadeltapapa@HIDDEN>)
 id 1fsYMz-0003dU-Aa
 for bug-gnu-emacs@HIDDEN; Wed, 22 Aug 2018 15:00:41 -0400
Received: by mail-ed1-f50.google.com with SMTP id q15-v6so2047593eds.5
 for <bug-gnu-emacs@HIDDEN>; Wed, 22 Aug 2018 12:00:40 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to
 :content-transfer-encoding;
 bh=KrYiidulSaX+M2x7lTOTnMDmq02C9y8PJJisY6ADQ3E=;
 b=JLymqkOkLoIGAUl4IwfXuFhXJB350m2wImOGmQi82ytPppwROdjcP0N19d4B5Ioz3n
 cNR2pObL4U/PJNf0T0xQt/2sN/nd6FLZu/QGMvUpqZP1CXRUQ8xe3FWg+dNYt8G2EyRZ
 0Apm3e7O9IVfw0swISWSxjRgD46J7qQNuJ7TsDTRFbFXIV/hC1jzn0lHqBaoelhuNSic
 ohfRE25AI7v1iDUNJydpYQDnsyobszENAGybH517FLF8bH0oZhTwkrgCdmRlTlmJ0wLg
 t087c5U/xLXFxQxp49gGp65MSuWjOeWd4wEs4dadNeqnCO2PJHBWO7lxIyHSWh/HOJJL
 Xv4Q==
X-Gm-Message-State: AOUpUlE/WjZtqsi7P9/3mgPMUwroMD+nC9iqNFixvqdifNYoME1GsHFx
 1r5AOUTZd4AtRDObq4Mr2fCLB6rBB5PvumsyOGptW3UV
X-Google-Smtp-Source: AA+uWPyQzBnvbKI0Akzq/NZ7zd+JpqyxGMB5kdayZVyTeljzjftVhfY5kPJcHjwpJRqeasZyUErW7WVX+MTv0vmA5fY=
X-Received: by 2002:a50:c201:: with SMTP id
 n1-v6mr67645493edf.11.1534964439954; 
 Wed, 22 Aug 2018 12:00:39 -0700 (PDT)
MIME-Version: 1.0
From: Adam Porter <adam@HIDDEN>
Date: Wed, 22 Aug 2018 14:00:28 -0500
Message-ID: <CAO_b3FV+BOeguJU+UFpfo6VnrJ9Q5ympyeX61RHaKQhtcyhfug@HIDDEN>
Subject: 26.1; Byte-compiled functions don't hash consistently
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.8 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.8 (----)

I noticed that byte-compiled functions don't hash consistently.  Here's
an ECM from Noam Postavsky
<https://github.com/skeeto/emacs-memoize/pull/10#issuecomment-415066682>:

    (let ((obj1 (byte-compile (lambda (x) x)))
          (obj2 (byte-compile (lambda (x) x))))
      (list (equal obj1 obj2)
            (eq obj1 obj2)
            (=3D (sxhash obj1)
               (sxhash obj2))))
    ;=3D> (t nil nil)

According to "(elisp) Defining Hash":

    If two objects OBJ1 and OBJ2 are equal, then =E2=80=98(sxhash OBJ1)=E2=
=80=99 and
    =E2=80=98(sxhash OBJ2)=E2=80=99 are the same integer.

This makes it impossible to use byte-compiled functions as keys or parts
of keys in hash tables.  A workaround is to `prin1-to-string` the
byte-compiled function and use that as the key.

Thanks.




Acknowledgement sent to Adam Porter <adam@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#32503; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 28 Apr 2022 11:45:02 UTC

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