From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#54079: 29.0.50; Method dispatching eratically fails Date: Sat, 5 Mar 2022 16:37:16 +0000 Message-ID: References: <87bkz113hz.fsf@web.de> <87mtik3l54.fsf@web.de> <87ilt6bgnt.fsf@web.de> <87sfsapgv0.fsf@web.de> <87o82ypfxz.fsf@web.de> <875youbhbu.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40351"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 54079@debbugs.gnu.org, monnier@iro.umontreal.ca To: Michael Heerdegen , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 05 17:38:11 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 1nQXQ3-000AOh-Ck for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Mar 2022 17:38:11 +0100 Original-Received: from localhost ([::1]:53936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQXQ1-00054V-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Mar 2022 11:38:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQXPu-000548-Vq for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2022 11:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQXPu-0004lo-NT for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2022 11:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nQXPu-0008Tn-GT for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2022 11:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Mar 2022 16:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54079 X-GNU-PR-Package: emacs Original-Received: via spool by 54079-submit@debbugs.gnu.org id=B54079.164649824732552 (code B ref 54079); Sat, 05 Mar 2022 16:38:02 +0000 Original-Received: (at 54079) by debbugs.gnu.org; 5 Mar 2022 16:37:27 +0000 Original-Received: from localhost ([127.0.0.1]:48942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQXPL-0008Sx-76 for submit@debbugs.gnu.org; Sat, 05 Mar 2022 11:37:27 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:49354 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nQXPJ-0008Sj-9Y for 54079@debbugs.gnu.org; Sat, 05 Mar 2022 11:37:25 -0500 Original-Received: (qmail 64429 invoked by uid 3782); 5 Mar 2022 16:37:17 -0000 Original-Received: from acm.muc.de (p2e5d5265.dip0.t-ipconnect.de [46.93.82.101]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 05 Mar 2022 17:37:17 +0100 Original-Received: (qmail 31510 invoked by uid 1000); 5 Mar 2022 16:37:16 -0000 Content-Disposition: inline In-Reply-To: <875youbhbu.fsf@web.de> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:228025 Archived-At: Hello, Michael. On Fri, Mar 04, 2022 at 03:08:05 +0100, Michael Heerdegen wrote: > Michael Heerdegen writes: > > This short recipe gives me the same error in emacs -Q: > > > > (byte-compile-file > > "/home/micha/software/emacs/lisp/emacs-lisp/cl-generic.el") > > (require 'gnus-search) > Small addition: it seems that all issues mentioned disappear when I > avoid any byte compilation in my session. Compilation of `defstruct's > seems to be the culprit (hypothesis). > Would be good to fix this problem not too late. I think it will > irritate or distract other people, too. I think this problem can only happen for defuns/defvars/defconts inside eval-when-compile or eval-and-compile. Would you try out the following patch, please, which I believe fixes the bug. Thanks! diff --git a/src/data.c b/src/data.c index 1526cc0c73..0854b4efb4 100644 --- a/src/data.c +++ b/src/data.c @@ -942,6 +942,13 @@ The return value is undefined. */) (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) { CHECK_SYMBOL (symbol); + /* If we're in a byte compilation, ensure the definition's symbols + are stripped of their positions. */ + if (symbols_with_pos_enabled + && SYMBOL_WITH_POS_P (symbol) + && Ffboundp (Qbyte_run_strip_symbol_positions)) + call1 (Qbyte_run_strip_symbol_positions, definition); + if (!NILP (Vpurify_flag) /* If `definition' is a keymap, immutable (and copying) is wrong. */ && !KEYMAPP (definition)) @@ -4352,6 +4359,8 @@ This variable cannot be set; trying to do so will signal an error. */); Bind this to non-nil in applications such as the byte compiler. */); symbols_with_pos_enabled = false; + DEFSYM (Qbyte_run_strip_symbol_positions, "byte-run-strip-symbol-positions"); + DEFSYM (Qwatchers, "watchers"); DEFSYM (Qmakunbound, "makunbound"); DEFSYM (Qunlet, "unlet"); diff --git a/src/eval.c b/src/eval.c index 294d79e67a..1b1fde3a20 100644 --- a/src/eval.c +++ b/src/eval.c @@ -794,6 +794,12 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) if (!NILP (XCDR (tail)) && !NILP (XCDR (XCDR (tail)))) error ("Too many arguments"); Lisp_Object exp = XCAR (tail); + /* If we're in a byte compilation, ensure the definition's + symbols are stripped of their positions. */ + if (symbols_with_pos_enabled + && SYMBOL_WITH_POS_P (sym) + && Ffboundp (Qbyte_run_strip_symbol_positions)) + call1 (Qbyte_run_strip_symbol_positions, exp); tem = Fdefault_boundp (sym); tail = XCDR (tail); @@ -861,6 +867,14 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) } Finternal__define_uninitialized_variable (sym, docstring); + + /* If we're in a byte compilation, ensure the definition's symbols + are stripped of their positions. */ + if (symbols_with_pos_enabled + && SYMBOL_WITH_POS_P (sym) + && Ffboundp (Qbyte_run_strip_symbol_positions)) + call1 (Qbyte_run_strip_symbol_positions, XCAR (XCDR (args))); + tem = eval_sub (XCAR (XCDR (args))); if (!NILP (Vpurify_flag)) tem = Fpurecopy (tem); > Michael. -- Alan Mackenzie (Nuremberg, Germany).