From unknown Fri Sep 19 18:22:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: acorallo@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jul 2023 01:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 64526@debbugs.gnu.org Cc: Andrea Corallo X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Andrea Corallo Received: via spool by submit@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 ) id 1qHwxV-0002gs-LS for submit@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 ) id 1qHwxQ-0002ge-Bc for submit@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 ) id 1qHwxQ-000505-2Z for bug-gnu-emacs@gnu.org; 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 ) id 1qHwxO-0006fq-Dz for bug-gnu-emacs@gnu.org; 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 ; 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 ; 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 ; Fri, 7 Jul 2023 21:41:46 -0400 (EDT) From: Stefan Monnier Date: Fri, 07 Jul 2023 21:41:24 -0400 Message-ID: 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@iro.umontreal.ca; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From unknown Fri Sep 19 18:22:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64526@debbugs.gnu.org Received: via spool by 64526-submit@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 ) id 1qIlZU-0004e9-BO for submit@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 ) id 1qIlZO-0004ds-WF for 64526@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 ) 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 ) id 1qIlZI-0003uK-TK; Mon, 10 Jul 2023 03:44:24 -0400 From: Andrea Corallo In-Reply-To: (Stefan Monnier's message of "Fri, 07 Jul 2023 21:41:24 -0400") References: Date: Mon, 10 Jul 2023 03:44:24 -0400 Message-ID: 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier 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 From unknown Fri Sep 19 18:22:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Corallo Cc: 64526@debbugs.gnu.org Received: via spool by 64526-submit@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 ) id 1qInLa-0007pS-U8 for submit@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 ) id 1qInLW-0007pA-Ge for 64526@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 In-Reply-To: (Andrea Corallo's message of "Mon, 10 Jul 2023 03:44:24 -0400") Message-ID: References: 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From unknown Fri Sep 19 18:22:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 11:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 64526@debbugs.gnu.org Received: via spool by 64526-submit@debbugs.gnu.org id=B64526.168898994232504 (code B ref 64526); Mon, 10 Jul 2023 11:53:02 +0000 Received: (at 64526) by debbugs.gnu.org; 10 Jul 2023 11:52:22 +0000 Received: from localhost ([127.0.0.1]:47866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIpRG-0008SC-0k for submit@debbugs.gnu.org; Mon, 10 Jul 2023 07:52:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIpRA-0008Ri-F7 for 64526@debbugs.gnu.org; Mon, 10 Jul 2023 07:52:20 -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 ) id 1qIpR5-0001RC-7D; Mon, 10 Jul 2023 07:52:11 -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=rZwDDzwC+V0oCu93vw8Ozqn5IJh7F2PrS7q+QUjS5gA=; b=KzQmDavp55nHWATBd3Em hOLNIdXoY0CIs+H3vSrxnH9cuD4K4isVAuAqkbS51pKjnqcEOH/hxp3lG8JXsrnkMGssj9keMqBoD izao9KSlDAyWvhjHKtzOlv3U9iWk1hPLErdfdEbXxgwUKWT0PiMkNiw79ie58EKvUtFNMoiV3+ys2 u3rrAtVPskl83gk4sVjU7wGKwrpvtUHUB5L1UR1SK6ZUkPiJi4lAj4aCWTXodhPKV2XlwnZNBUf9c RpqbVGUdwf4dQy5zC6vl6wlW4+M6VvAjs5aRn6stC7hlV3GXMfFL66pJwqWIxCsrmb/NKXt7UUOZ6 DQ2fP7YzOUf6+w==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qIpR5-0000hb-14; Mon, 10 Jul 2023 07:52:11 -0400 From: Andrea Corallo In-Reply-To: (Stefan Monnier's message of "Mon, 10 Jul 2023 05:38:11 -0400") References: Date: Mon, 10 Jul 2023 07:52:10 -0400 Message-ID: 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier 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? > > Yes, the above recipe reproduces it on my machine at least. Okay, will look at thanks. Andrea