X-Loop: help-debbugs@HIDDEN
Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: acorallo@HIDDEN, bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 08 Jul 2023 01:43:02 +0000
Resent-Message-ID: <handler.64526.B.168878052210354 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 64526
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 64526 <at> debbugs.gnu.org
Cc: Andrea Corallo <acorallo@HIDDEN>
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
X-Debbugs-Original-Xcc: Andrea Corallo <acorallo@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.168878052210354
(code B ref -1); Sat, 08 Jul 2023 01:43:02 +0000
Received: (at submit) by debbugs.gnu.org; 8 Jul 2023 01:42:02 +0000
Received: from localhost ([127.0.0.1]:43954 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1qHwxV-0002gs-LS
for submit <at> debbugs.gnu.org; Fri, 07 Jul 2023 21:42:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:46578)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <monnier@HIDDEN>) id 1qHwxQ-0002ge-Bc
for submit <at> debbugs.gnu.org; Fri, 07 Jul 2023 21:42:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
id 1qHwxQ-000505-2Z
for bug-gnu-emacs@HIDDEN; Fri, 07 Jul 2023 21:41:56 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
id 1qHwxO-0006fq-Dz
for bug-gnu-emacs@HIDDEN; Fri, 07 Jul 2023 21:41:55 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7EC3344264C
for <bug-gnu-emacs@HIDDEN>; Fri, 7 Jul 2023 21:41:52 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BA59144264E
for <bug-gnu-emacs@HIDDEN>; Fri, 7 Jul 2023 21:41:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
s=mail; t=1688780506;
bh=F4uXBXdDMSgCeyREa9wh5S5y7tCTvkUTzWQ99twIgWM=;
h=From:To:Subject:Date:From;
b=jpDd01HNSXm3NZtdm3MS8bIF+ofBhmasiJKXB7DNMBqFhXU43hETpF2OdDNqa9bq4
9PiQmmds76kZXXadrQ1WBE+48g7JDvAjH6ooJ1/sKeHUbyInZN7jFIIHDVbGn1rcoE
zBjIxGlVWVKlrrFnIylLTvt4ss2tdqjDoUrObvyCvTApYo5l6QuueJkN0q62XxJK0G
Rp2IY1lPrW04QiKjUMyzMF77iKxri/GLibMAMozzMYFCQ5tC+VAgZB9x8PwSjXdt3M
4mdTpPD0rzoxDoD3rucNnDtnLcdCQ6ncGITQ9wt3t1hS24XfrPHlUYe+3+w+bti/Rs
wxIcVz0HK+AGA==
Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162])
by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A0A87120211
for <bug-gnu-emacs@HIDDEN>; Fri, 7 Jul 2023 21:41:46 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Date: Fri, 07 Jul 2023 21:41:24 -0400
Message-ID: <jwv7crbw56j.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results: 0
ALL_TRUSTED -1 Passed through trusted hosts only via SMTP
AWL -0.045 Adjusted score from AWL reputation of From: address
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DKIM_SIGNED 0.1 Message has a DKIM or DK signature,
not necessarily valid
DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
domain
DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
domain T_SCC_BODY_TEXT_LINE -0.01 -
X-SPAM-LEVEL:
Received-SPF: pass client-ip=132.204.25.50;
envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
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: -2.3 (--)
Package: Emacs
Version: 30.0.50
Say you have a file ~/tmp/foo.el:
;; -*- lexical-binding: t; -*-
(defun sm-foo1 (a) (list a 1))
(defun sm-foo1 (a) (list a 2))
which you byte-compile into ~/tmp/foo.elc, and then you do:
emacs -Q -l ~/tmp/foo
M-: (sm-foo1 'a) RET
you'll usually get `(a 2)` (and that's what we expect). But if you enable
native compilation and erase the `eln-cache` before trying it out you
may get `(a 1)` because when the `.eln` file is reloaded on top of the
`.elc` definitions, `comp--late-register-subr` will skip the second
definition :-(
I suspect similar problems can occur when the two definitions are placed
in different files (and those files are loaded "at the same time",
i.e. the second file is loaded before the native-compilation of the
first file finishes) since `comp-deferred-pending-h` does not pay
attention to the file names. :-(
Stefan
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Stefan Monnier <monnier@HIDDEN> Subject: bug#64526: Acknowledgement (30.0.50; jit-compilation and multiple function definitions) Message-ID: <handler.64526.B.168878052210354.ack <at> debbugs.gnu.org> References: <jwv7crbw56j.fsf@HIDDEN> X-Gnu-PR-Message: ack 64526 X-Gnu-PR-Package: emacs Reply-To: 64526 <at> debbugs.gnu.org Date: Sat, 08 Jul 2023 01:43:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. As you requested using X-Debbugs-CC, your message was also forwarded to Andrea Corallo <acorallo@HIDDEN> (after having been given a bug report number, if it did not have one). Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 64526 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 64526: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64526 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions
Resent-From: Andrea Corallo <acorallo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 10 Jul 2023 07:45:01 +0000
Resent-Message-ID: <handler.64526.B64526.168897507817872 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 64526
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Stefan Monnier <monnier@HIDDEN>
Cc: 64526 <at> debbugs.gnu.org
Received: via spool by 64526-submit <at> debbugs.gnu.org id=B64526.168897507817872
(code B ref 64526); Mon, 10 Jul 2023 07:45:01 +0000
Received: (at 64526) by debbugs.gnu.org; 10 Jul 2023 07:44:38 +0000
Received: from localhost ([127.0.0.1]:47653 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1qIlZU-0004e9-BO
for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 03:44:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54460)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <acorallo@HIDDEN>) id 1qIlZO-0004ds-WF
for 64526 <at> debbugs.gnu.org; Mon, 10 Jul 2023 03:44:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <acorallo@HIDDEN>)
id 1qIlZJ-0003lh-5i; Mon, 10 Jul 2023 03:44:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
From; bh=OBWCDpR5VAMAKkZht0RNTfrMApg9nEzLO4MxA5H8UZk=; b=Gyln33p1/z0tNb8xVOfD
EpuQCZwuFN32A/j6Nq6l31CrJLYyOmbDAU3jAWaFepctdy/cZ5efPX2JUu9FOhJllhBGE03sC9pT1
DVdAjlsgW1YSfFW1vyra+fxSBf2xYZOxrXjk4BTP8HiejzjQHbfkva6f5C/GK/cmgCr6ZYzhIybc/
mDiItfsGaZflQ0+CXF4NX/4HO942mGPyWOUdHL+ZBwpjaphaVkbOrs4aDoZWBtlmdsCQoO9EfZ7jy
0oSKZ4JHP+A9ro0sjgfuFccgUfIjgwTCuLqKwe8HBAxsJ3lLkch78G2t3VH1Nbfveow4NJIwKkrWb
xqbfwi3rbaYIZA==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
(envelope-from <acorallo@HIDDEN>)
id 1qIlZI-0003uK-TK; Mon, 10 Jul 2023 03:44:24 -0400
From: Andrea Corallo <acorallo@HIDDEN>
In-Reply-To: <jwv7crbw56j.fsf@HIDDEN> (Stefan Monnier's message of
"Fri, 07 Jul 2023 21:41:24 -0400")
References: <jwv7crbw56j.fsf@HIDDEN>
Date: Mon, 10 Jul 2023 03:44:24 -0400
Message-ID: <yp15y6sus6f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
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 (---)
Stefan Monnier <monnier@HIDDEN> writes:
> Package: Emacs
> Version: 30.0.50
>
>
> Say you have a file ~/tmp/foo.el:
>
> ;; -*- lexical-binding: t; -*-
> (defun sm-foo1 (a) (list a 1))
> (defun sm-foo1 (a) (list a 2))
>
> which you byte-compile into ~/tmp/foo.elc, and then you do:
>
> emacs -Q -l ~/tmp/foo
> M-: (sm-foo1 'a) RET
>
> you'll usually get `(a 2)` (and that's what we expect). But if you enable
> native compilation and erase the `eln-cache` before trying it out you
> may get `(a 1)` because when the `.eln` file is reloaded on top of the
> `.elc` definitions, `comp--late-register-subr` will skip the second
> definition :-(
Hi Stefan,
are we sure about this? Is this reproducible?
Thanks
Andrea
> I suspect similar problems can occur when the two definitions are placed
> in different files (and those files are loaded "at the same time",
> i.e. the second file is loaded before the native-compilation of the
> first file finishes) since `comp-deferred-pending-h` does not pay
> attention to the file names. :-(
>
>
> Stefan
X-Loop: help-debbugs@HIDDEN
Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 10 Jul 2023 09:39:02 +0000
Resent-Message-ID: <handler.64526.B64526.168898190330102 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 64526
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Andrea Corallo <acorallo@HIDDEN>
Cc: 64526 <at> debbugs.gnu.org
Received: via spool by 64526-submit <at> debbugs.gnu.org id=B64526.168898190330102
(code B ref 64526); Mon, 10 Jul 2023 09:39:02 +0000
Received: (at 64526) by debbugs.gnu.org; 10 Jul 2023 09:38:23 +0000
Received: from localhost ([127.0.0.1]:47775 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1qInLa-0007pS-U8
for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 05:38:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31718)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <monnier@HIDDEN>) id 1qInLW-0007pA-Ge
for 64526 <at> debbugs.gnu.org; Mon, 10 Jul 2023 05:38:22 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DDCF21000C4;
Mon, 10 Jul 2023 05:38:12 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F007F1000B9;
Mon, 10 Jul 2023 05:38:11 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
s=mail; t=1688981892;
bh=7Uz3osdiwrbkqm83O+882ajWSXA3FjvOlk2X1iebRi8=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=TiC4vknSNTW9Z7RC+wq5yiW0Xye1l6Js83UBuOIlvWdGLFNTdk/lrFVrqfwBjPlsr
78b++rykQChvUBplv1KY1GZl4nWNxeUg8k96xSDIPVAt8h8k/TLs30eyAKyu6Tw6J5
DEkFpM/gjOSQGFGlETqWGtHY4/17STyO4AoSzAEWoxAu29WZBRDPT+z047X+9nyTec
zGqAvC5cb1V9uoLoRuVNtMY6nuOxUPOfAxkSjfpKf3kXbHAILfWO66o+edyQ/faCvC
A/EhYE5r/ygH9eoOCreUMSZbioDp+zb/3AzVu+hQn85D++cMYvIpjuaH5W3XMYnIUl
1KLOsC8NxhKgw==
Received: from pastel (unknown [24.140.234.50])
by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CE9A2120283;
Mon, 10 Jul 2023 05:38:11 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <yp15y6sus6f.fsf@HIDDEN> (Andrea Corallo's message of
"Mon, 10 Jul 2023 03:44:24 -0400")
Message-ID: <jwvfs5wp0o9.fsf-monnier+emacs@HIDDEN>
References: <jwv7crbw56j.fsf@HIDDEN>
<yp15y6sus6f.fsf@HIDDEN>
Date: Mon, 10 Jul 2023 05:38:11 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results: 0
ALL_TRUSTED -1 Passed through trusted hosts only via SMTP
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DKIM_SIGNED 0.1 Message has a DKIM or DK signature,
not necessarily valid
DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
domain
DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
domain T_SCC_BODY_TEXT_LINE -0.01 -
X-SPAM-LEVEL:
X-Spam-Score: -2.3 (--)
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 (---)
>> Package: Emacs
>> Version: 30.0.50
>>
>>
>> Say you have a file ~/tmp/foo.el:
>>
>> ;; -*- lexical-binding: t; -*-
>> (defun sm-foo1 (a) (list a 1))
>> (defun sm-foo1 (a) (list a 2))
>>
>> which you byte-compile into ~/tmp/foo.elc, and then you do:
>>
>> emacs -Q -l ~/tmp/foo
>> M-: (sm-foo1 'a) RET
>>
>> you'll usually get `(a 2)` (and that's what we expect). But if you enable
>> native compilation and erase the `eln-cache` before trying it out you
>> may get `(a 1)` because when the `.eln` file is reloaded on top of the
>> `.elc` definitions, `comp--late-register-subr` will skip the second
>> definition :-(
>
> Hi Stefan,
>
> are we sure about this? Is this reproducible?
Yes, the above recipe reproduces it on my machine at least.
Stefan
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.