GNU bug report logs - #62317
28.2; This byte-compiled file behaves wrongly.

Previous Next

Package: emacs;

Reported by: Teika Kazura <teika <at> gmx.com>

Date: Tue, 21 Mar 2023 03:58:02 UTC

Severity: normal

Tags: patch, wontfix

Found in version 28.2

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62317 in the body.
You can then email your comments to 62317 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 21 Mar 2023 03:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teika Kazura <teika <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 21 Mar 2023 03:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; This byte-compiled file behaves wrongly.
Date: Tue, 21 Mar 2023 12:54:08 +0900 (JST)
Hi. In the situation below, a byte-compiled init code's evaluation is not completed, but emacs starts as if nothing was wrong.

* How to reproduce:
First, ~/.emacs.d/init.el:
------------------------------------------------------------------------
(eval-and-compile
  (push user-emacs-directory load-path)
  (require 'a))

;; Hereafter is ignored when byte-compiled.

(defvar foo-var 'baz)
(message "Hello, world.")
(pop-to-buffer "*Messages*")
------------------------------------------------------------------------

~/.emacs.d/a.el:
------------------------------------------------------------------------
(set-buffer "*Messages*") ;; or (set-buffer (get-buffer-create "bar"))
(provide 'a)
------------------------------------------------------------------------

Byte compile these two files *in this order*:
$ cd ~/.emacs.d; emacs -Q -batch -f batch-byte-compile a.el init.el

(you can now remove a.elc; it doesn't matter this bug.)
Finally, run emacs as either of these:
$ emacs -Q -l init.elc
$ emacs --no-splash --no-site-file 

* Symptom
As I commented in init.el, the code after `require' is ignored when init.el is byte-compiled. However, emacs starts as if nothing was wrong.

The line of `set-buffer' in a.el seems to trigger this bug. If you delete that line, this bug doesn't occur.

* version and build info:
In short, emacs 28 regression, but I don't know the exact version - My 28.1 was without gcc-jit, and this bug was not there. The 28.2 is built with gcc-jit, and the bug hits me.

Full build info:
------------------------------------------------------------------------
Gentoo Linux
GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) of 2023-02-02

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-28.2-r4
 --htmldir=/usr/share/doc/emacs-28.2-r4/html --libdir=/usr/lib64
 --program-suffix=-emacs-28 --includedir=/usr/include/emacs-28
 --infodir=/usr/share/info/emacs-28 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --without-dbus --with-modules --without-gameuser --with-libgmp
 --without-gpm --with-native-compilation --with-json --without-kerberos
 --without-kerberos5 --without-lcms2 --with-xml2 --without-mailutils
 --without-selinux --with-gnutls --without-libsystemd --with-threads
 --with-wide-int --with-sound=no --with-zlib --with-x --without-ns
 --without-gconf --with-gsettings --without-toolkit-scroll-bars
 --without-gif --without-jpeg --without-png --without-rsvg
 --without-tiff --without-xpm --without-imagemagick --with-xft
 --with-cairo --with-harfbuzz --with-libotf --with-m17n-flt
 --with-x-toolkit=gtk3 --without-xwidgets --with-dumping=pdumper
 'CFLAGS=-march=native -O2 -pipe' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
ACL CAIRO FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JSON LIBOTF
LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER SECCOMP
THREADS X11 XDBE XIM GTK3 ZLIB
------------------------------------------------------------------------

Thanks, Emacs developers. Best regards,
Teika 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Wed, 22 Mar 2023 06:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Wed, 22 Mar 2023 15:39:04 +0900 (JST)
As a workaround, you can wrap `set-buffer' with save-excursion, with-current-buffer, or save-current-buffer. Then it works correctly.

Teika




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 28 Mar 2023 09:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Tue, 28 Mar 2023 18:15:44 +0900 (JST)
This bug is also related to native-compilation, but I can't demonstrate it in a simple way.

The situation for the init.el that I really use is:
* I suspect that the pair of require - set-buffer causes the bug. At least, the above workaround works, wrapping set-buffer.
* There the existence of init.elc does not matter. Instead, the init-<hash>.eln is the problem. By removing it, the bug disappears.
* But each time I run emacs, an eln is automatically generated aynchronously if it's lacking. (I can't find what causes automatic native compilation.)

Anyway fixing this bug will solve other native-compilation related bugs, if any. 

Regards,
Teika




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 28 Mar 2023 12:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Teika Kazura <teika <at> gmx.com>, Andrea Corallo <akrl <at> sdf.org>
Cc: 62317 <at> debbugs.gnu.org
Subject: Re: bug#62317: bug #62317: 28.2;
 This byte-compiled file behaves wrongly.
Date: Tue, 28 Mar 2023 15:08:16 +0300
> Date: Tue, 28 Mar 2023 18:15:44 +0900 (JST)
> From: Teika Kazura <teika <at> gmx.com>
> 
> This bug is also related to native-compilation, but I can't demonstrate it in a simple way.
> 
> The situation for the init.el that I really use is:
> * I suspect that the pair of require - set-buffer causes the bug. At least, the above workaround works, wrapping set-buffer.
> * There the existence of init.elc does not matter. Instead, the init-<hash>.eln is the problem. By removing it, the bug disappears.
> * But each time I run emacs, an eln is automatically generated aynchronously if it's lacking. (I can't find what causes automatic native compilation.)

Native compilation is always triggered when Emacs loads a .elc file
for which there is no corresponding .eln.

> Anyway fixing this bug will solve other native-compilation related bugs, if any. 

CC'ing Andrea.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 28 Mar 2023 12:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62317 <at> debbugs.gnu.org, Teika Kazura <teika <at> gmx.com>
Subject: Re: bug#62317: bug #62317: 28.2; This byte-compiled file behaves
 wrongly.
Date: Tue, 28 Mar 2023 12:43:33 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Tue, 28 Mar 2023 18:15:44 +0900 (JST)
>> From: Teika Kazura <teika <at> gmx.com>
>> 
>> This bug is also related to native-compilation, but I can't demonstrate it in a simple way.
>> 
>> The situation for the init.el that I really use is:
>> * I suspect that the pair of require - set-buffer causes the bug. At least, the above workaround works, wrapping set-buffer.
>> * There the existence of init.elc does not matter. Instead, the init-<hash>.eln is the problem. By removing it, the bug disappears.
>> * But each time I run emacs, an eln is automatically generated aynchronously if it's lacking. (I can't find what causes automatic native compilation.)
>
> Native compilation is always triggered when Emacs loads a .elc file
> for which there is no corresponding .eln.
>
>> Anyway fixing this bug will solve other native-compilation related bugs, if any. 
>
> CC'ing Andrea.

Yes, I guess it's all caused by
263d6c38539691c954f4c3057cbe8d5468499b91.

I'm in a business trip now but I want to fix it ASAP (within the week),
I already started to look into it.

Anyway if we feel this is causing too much disruption I'm happy to
revert the offending commit now WDYT?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 28 Mar 2023 12:54:02 GMT) Full text and rfc822 format available.

Message #20 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com
Subject: Re: bug#62317: bug #62317: 28.2; This byte-compiled file behaves
 wrongly.
Date: Tue, 28 Mar 2023 15:53:10 +0300
> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: Teika Kazura <teika <at> gmx.com>, 62317 <at> debbugs.gnu.org
> Date: Tue, 28 Mar 2023 12:43:33 +0000
> 
> Anyway if we feel this is causing too much disruption I'm happy to
> revert the offending commit now WDYT?

Yes, maybe we should revert until the solution is found.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 28 Mar 2023 13:50:01 GMT) Full text and rfc822 format available.

Message #23 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com
Subject: Re: bug#62317: bug #62317: 28.2; This byte-compiled file behaves
 wrongly.
Date: Tue, 28 Mar 2023 13:49:01 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andrea Corallo <akrl <at> sdf.org>
>> Cc: Teika Kazura <teika <at> gmx.com>, 62317 <at> debbugs.gnu.org
>> Date: Tue, 28 Mar 2023 12:43:33 +0000
>> 
>> Anyway if we feel this is causing too much disruption I'm happy to
>> revert the offending commit now WDYT?
>
> Yes, maybe we should revert until the solution is found.

I agree.  I reverted now the patch series into 29.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Thu, 30 Mar 2023 09:22:02 GMT) Full text and rfc822 format available.

Message #26 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, akrl <at> sdf.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Thu, 30 Mar 2023 18:20:45 +0900 (JST)
Hi. I found a relation of this bug to native compilation, but there's a new, independent bug. Anyway remember the problem here is the pair of require - set-buffer, and I'm using 28.2. (I know it's not safe. :p)

What surprises is that `native-compile-async' and `batch-native-compile' generate differnt codes. To show it, use the same init.el and a.el above. Byte-compile first a.el, then init.el. Next native-compile init.el. Run emacs, and the above bug appears.

The difference is that (i) if you use native-compile-async, by removing one of init-<hash>.eln or init.elc, the bug disappears, even if the other remains. But (ii) if you use "$ emacs -Q -batch -f batch-native-compile *el", eln in fact does not matter; only the presence of init.elc screws things up.

# Who can expect this?

At the very least, native-compilation has too many undocumented aspects. If you want, I'll open a new bug for this discrepancy.

# It's off-topic for this bug, but for the above sample code, automatic, asynchronous generation of an eln file does not happen, unlike the case of my real init.el. I can't find the reason yet.

Regards,
Teika





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Thu, 30 Mar 2023 09:42:01 GMT) Full text and rfc822 format available.

Message #29 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Teika Kazura <teika <at> gmx.com>
Cc: 62317 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Thu, 30 Mar 2023 12:41:18 +0300
> Date: Thu, 30 Mar 2023 18:20:45 +0900 (JST)
> Cc: eliz <at> gnu.org, akrl <at> sdf.org
> From: Teika Kazura <teika <at> gmx.com>
> 
> What surprises is that `native-compile-async' and `batch-native-compile' generate differnt codes. To show it, use the same init.el and a.el above. Byte-compile first a.el, then init.el. Next native-compile init.el. Run emacs, and the above bug appears.

This is not surprising at all: native-compile-async compiles in a
separate process with environment unaffected by your customizations,
whereas batch-native-compile compiles in the current session, and thus
inherits all of your customizations.

> The difference is that (i) if you use native-compile-async, by removing one of init-<hash>.eln or init.elc, the bug disappears, even if the other remains. But (ii) if you use "$ emacs -Q -batch -f batch-native-compile *el", eln in fact does not matter; only the presence of init.elc screws things up.
> 
> # Who can expect this?
> 
> At the very least, native-compilation has too many undocumented aspects. If you want, I'll open a new bug for this discrepancy.
> 
> # It's off-topic for this bug, but for the above sample code, automatic, asynchronous generation of an eln file does not happen, unlike the case of my real init.el. I can't find the reason yet.

If the above happens in "emacs -Q", a reproducible recipe will help.
And please try that in Emacs 29 if you can, since we don't plan on any
releases of Emacs 28 with any substantial changes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 07:39:02 GMT) Full text and rfc822 format available.

Message #32 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, akrl <at> sdf.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 16:36:49 +0900 (JST)
Sorry for having messed, but native compilation is a separate issue which is to be discussed elsewhere.

The original bug exists for the 29 git head, and for 28.3. [1] It's a pure byte-compilation problem, and the reproduction procedure in Message #5 remains valid. The workaround above works also for 29.

[1] For the 29, I used d0eb12e8d3c9d6f95b8493e05857d583c29dd0fe (2023-03-31) and "28.3" is actually 28.2 + three vulnerebility fixes by my distro, Gentoo Linux. Both are built *without* libgcc, i.e. with --without-native-compilation.

For the native compilation issue, sorry, I can't help. It's difficult for me to recompile repeatedly with --with-native-compilation. (Building 29 took about 3 times longer than 28.)

Thank you,
Teika




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 08:09:01 GMT) Full text and rfc822 format available.

Message #35 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Teika Kazura <teika <at> gmx.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62317 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 11:08:14 +0300
> Date: Sat, 01 Apr 2023 16:36:49 +0900 (JST)
> Cc: eliz <at> gnu.org, akrl <at> sdf.org
> From: Teika Kazura <teika <at> gmx.com>
> 
> Sorry for having messed, but native compilation is a separate issue which is to be discussed elsewhere.
> 
> The original bug exists for the 29 git head, and for 28.3. [1] It's a pure byte-compilation problem, and the reproduction procedure in Message #5 remains valid. The workaround above works also for 29.
> 
> [1] For the 29, I used d0eb12e8d3c9d6f95b8493e05857d583c29dd0fe (2023-03-31) and "28.3" is actually 28.2 + three vulnerebility fixes by my distro, Gentoo Linux. Both are built *without* libgcc, i.e. with --without-native-compilation.
> 
> For the native compilation issue, sorry, I can't help. It's difficult for me to recompile repeatedly with --with-native-compilation. (Building 29 took about 3 times longer than 28.)

Stefan, any ideas?  I think switching to a different buffer inside
eval-and-compile is a bad idea, but maybe I'm missing something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 16:28:02 GMT) Full text and rfc822 format available.

Message #38 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Teika Kazura <teika <at> gmx.com>
Cc: 62317 <at> debbugs.gnu.org
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 12:27:35 -0400
> * How to reproduce:
> First, ~/.emacs.d/init.el:
> ------------------------------------------------------------------------
> (eval-and-compile
>   (push user-emacs-directory load-path)
>   (require 'a))
>
> ;; Hereafter is ignored when byte-compiled.
>
> (defvar foo-var 'baz)
> (message "Hello, world.")
> (pop-to-buffer "*Messages*")
> ------------------------------------------------------------------------
>
> ~/.emacs.d/a.el:
> ------------------------------------------------------------------------
> (set-buffer "*Messages*") ;; or (set-buffer (get-buffer-create "bar"))
> (provide 'a)
> ------------------------------------------------------------------------

I suspect you can simplify the above to:

    (eval-and-compile (set-buffer "*Messages*"))
    ;; Hereafter is ignored when byte-compiled.
    (message "Hello, world.")

> Stefan, any ideas?  I think switching to a different buffer inside
> `eval-and-compile` is a bad idea, but maybe I'm missing something.

I tend to agree.
[ Side note: (push user-emacs-directory load-path) is also a bad idea.  ]

We could guard against this to some extent, but there will always be
ways for the code executed at compile-time to mess up the state of
the compiler, so I'm not sure where we should draw the line.

FWIW, in my book `set-buffer` is a code smell (usually better replaced
by `with-current-buffer`).

Admittedly, the resulting behavior can be very puzzling&frustrating for
the user, which would tend to argue in favor of trying to at least
detect the problem.
But note that if the code switched to a buffer where point is not at
EOB, we'd probably get helpful error messages during compilation, so
I'm leaning towards considering it a "minor corner case" issue, but
I think the untested patch below would be enough to plug the hole.


        Stefan


diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 5df1205869c..e22ab94e378 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2376,7 +2376,10 @@ byte-compile-from-buffer
                  (form (read-positioning-symbols inbuffer))
                  (warning (byte-run--unescaped-character-literals-warning)))
             (when warning (byte-compile-warn-x form "%s" warning))
-	    (byte-compile-toplevel-file-form form)))
+            ;; Defend against macros using `set-buffer' or `goto-char'
+            ;; bug#62317.
+            (save-excursion
+	      (byte-compile-toplevel-file-form form))))
 	;; Compile pending forms at end of file.
 	(byte-compile-flush-pending)
 	(byte-compile-warn-about-unresolved-functions)))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 17:11:02 GMT) Full text and rfc822 format available.

Message #41 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 20:10:42 +0300
> Cc: 62317 <at> debbugs.gnu.org
> Date: Sat, 01 Apr 2023 12:27:35 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> I think the untested patch below would be enough to plug the hole.

LGTM, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 23:10:02 GMT) Full text and rfc822 format available.

Message #44 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 19:09:42 -0400
>> I think the untested patch below would be enough to plug the hole.
> LGTM, thanks.

You're thinking of it for `emacs-29`, right?
Then I had better test it before I push it :-)


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sat, 01 Apr 2023 23:16:02 GMT) Full text and rfc822 format available.

Message #47 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Teika Kazura <teika <at> gmx.com>
Cc: 62317 <at> debbugs.gnu.org
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sat, 01 Apr 2023 19:15:33 -0400
H Teika,

> I think the untested patch below would be enough to plug the hole.

Could you test that patch to make sure it fixes the problem for you?
You'll need to first apply the patch, then recompile the
`bytecomp.el` file, and only after that re-try compiling the init
file(s) where you saw the problem.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Sun, 02 Apr 2023 05:18:01 GMT) Full text and rfc822 format available.

Message #50 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Sun, 02 Apr 2023 08:17:24 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: teika <at> gmx.com,  62317 <at> debbugs.gnu.org
> Date: Sat, 01 Apr 2023 19:09:42 -0400
> 
> >> I think the untested patch below would be enough to plug the hole.
> > LGTM, thanks.
> 
> You're thinking of it for `emacs-29`, right?

Not necessarily.

> Then I had better test it before I push it :-)

That's always a good idea.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Wed, 05 Apr 2023 04:14:02 GMT) Full text and rfc822 format available.

Message #53 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug #62317: 28.2; This byte-compiled file behaves wrongly.
Date: Wed, 05 Apr 2023 13:12:41 +0900 (JST)
Thanks, that patch works for me. To be precise, I didn't byte-compile `bytecomp.el', (because it failed with batch-byte-compile) so instead I simply deleted bytecomp.elc.

BTW
> Admittedly, the resulting behavior can be very puzzling&frustrating for
> the user, which would tend to argue in favor of trying to at least
> detect the problem.

Good observation, ethologically and/or sociologically. :)

>> What surprises is that `native-compile-async' and `batch-native-compile' generate differnt codes.[...]
> This is not surprising at all[...]

IMHO a better bug-reporting guide seems desirable (or bug reporting "standard / protocol"). Or else, silly - censorship - untrained users like me will continue complaining, being a burden to developers. After all, coexistence of el, elc, and eln is too complicating. 

Let me express my gratitude, Eli. Je vous remercie, Stefan; and Grazie to Andrea, though not cc-ed.

Best regards,
Teika






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 12 Sep 2023 00:09:02 GMT) Full text and rfc822 format available.

Message #56 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Mon, 11 Sep 2023 17:08:29 -0700
tags 62317 + patch
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Cc: teika <at> gmx.com,  62317 <at> debbugs.gnu.org
>> Date: Sat, 01 Apr 2023 19:09:42 -0400
>>
>> >> I think the untested patch below would be enough to plug the hole.
>> > LGTM, thanks.
>>
>> You're thinking of it for `emacs-29`, right?
>
> Not necessarily.
>
>> Then I had better test it before I push it :-)
>
> That's always a good idea.

It seems like this patch was never installed.

Could we get it installed please?




Added tag(s) patch. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 12 Sep 2023 00:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 12 Sep 2023 00:10:01 GMT) Full text and rfc822 format available.

Message #61 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62317 <at> debbugs.gnu.org, Teika Kazura <teika <at> gmx.com>
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Mon, 11 Sep 2023 17:09:04 -0700
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> H Teika,
>
>> I think the untested patch below would be enough to plug the hole.
>
> Could you test that patch to make sure it fixes the problem for you?
> You'll need to first apply the patch, then recompile the
> `bytecomp.el` file, and only after that re-try compiling the init
> file(s) where you saw the problem.

Ping.  Teika, did you get a chance to test the patch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Tue, 12 Sep 2023 18:13:01 GMT) Full text and rfc822 format available.

Message #64 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 62317 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, teika <at> gmx.com
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Tue, 12 Sep 2023 14:12:27 -0400
> It seems like this patch was never installed.

To be honest, I'm not sure it's worth the trouble.

I'd argue that the bug is in having side-effects like that inside
`eval-and/when-compile` (or at the top-level of a `require`d file).
The patch only caters to changes to the `current_buffer` but there can
be many other ways to cause similar troubles and I can't think of a good
way to confine them all.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Wed, 13 Sep 2023 14:03:02 GMT) Full text and rfc822 format available.

Message #67 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62317 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, teika <at> gmx.com
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Wed, 13 Sep 2023 07:02:38 -0700
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> It seems like this patch was never installed.
>
> To be honest, I'm not sure it's worth the trouble.
>
> I'd argue that the bug is in having side-effects like that inside
> `eval-and/when-compile` (or at the top-level of a `require`d file).
> The patch only caters to changes to the `current_buffer` but there can
> be many other ways to cause similar troubles and I can't think of a good
> way to confine them all.

Good point.  It seems rather unusual to call `set-buffer' from the
top-level of a required file, to say the least.  And if we accept that,
users can start calling all kinds of weird and wonderful things.

On the other hand, the fix seems innocuous enough.

Eli, what do you think?  Should we close this as wontfix?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Wed, 13 Sep 2023 14:46:02 GMT) Full text and rfc822 format available.

Message #70 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com, monnier <at> iro.umontreal.ca
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Wed, 13 Sep 2023 17:45:08 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Wed, 13 Sep 2023 07:02:38 -0700
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 62317 <at> debbugs.gnu.org, teika <at> gmx.com
> 
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> 
> >> It seems like this patch was never installed.
> >
> > To be honest, I'm not sure it's worth the trouble.
> >
> > I'd argue that the bug is in having side-effects like that inside
> > `eval-and/when-compile` (or at the top-level of a `require`d file).
> > The patch only caters to changes to the `current_buffer` but there can
> > be many other ways to cause similar troubles and I can't think of a good
> > way to confine them all.
> 
> Good point.  It seems rather unusual to call `set-buffer' from the
> top-level of a required file, to say the least.  And if we accept that,
> users can start calling all kinds of weird and wonderful things.
> 
> On the other hand, the fix seems innocuous enough.
> 
> Eli, what do you think?  Should we close this as wontfix?

Given that Stefan Monnier himself is not sure, yes, I think we should
close this as wontfix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Wed, 13 Sep 2023 15:48:02 GMT) Full text and rfc822 format available.

Message #73 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62317 <at> debbugs.gnu.org, teika <at> gmx.com, monnier <at> iro.umontreal.ca
Subject: Re: bug#62317: 28.2; This byte-compiled file behaves wrongly.
Date: Wed, 13 Sep 2023 08:46:59 -0700
tags 62317 + wontfix
close 62317
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> Eli, what do you think?  Should we close this as wontfix?
>
> Given that Stefan Monnier himself is not sure, yes, I think we should
> close this as wontfix.

Thanks, now done.




Added tag(s) wontfix. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 13 Sep 2023 15:48:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 62317 <at> debbugs.gnu.org and Teika Kazura <teika <at> gmx.com> Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 13 Sep 2023 15:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62317; Package emacs. (Thu, 14 Sep 2023 06:37:01 GMT) Full text and rfc822 format available.

Message #80 received at 62317 <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: 62317 <at> debbugs.gnu.org
Subject: Re: bug#62317 acknowledged by developer
Date: Thu, 14 Sep 2023 15:35:38 +0900 (JST)
Thanks all, and sorry for untrained report.

Best wishes,
Teika




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Oct 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 190 days ago.

Previous Next


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