GNU bug report logs - #50285
28.0.50; Mew dosen't work correctly if .el files of Mew are native compiled

Previous Next

Package: emacs;

Reported by: Yasuhiro Kimura <yasu <at> utahime.org>

Date: Mon, 30 Aug 2021 20:40:01 UTC

Severity: normal

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 50285 in the body.
You can then email your comments to 50285 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 monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Mon, 30 Aug 2021 20:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yasuhiro Kimura <yasu <at> utahime.org>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Mon, 30 Aug 2021 20:40:01 GMT) Full text and rfc822 format available.

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

From: Yasuhiro Kimura <yasu <at> utahime.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Mew dosen't work correctly if .el files of Mew are native
 compiled
Date: Tue, 31 Aug 2021 05:38:46 +0900 (JST)
Mew is a mail reader for Emacs (http://www.mew.org/). While testing
native compilation with FreeBSD amd64, I faced the problem that Mew
doesn't work correctly if .el files of Mew are native compiled.

I reported the problem to mailing list of Mew and recieved a reply
that Debian also faces it and works it around by setting
'no-native-compile' variable to 't' as file-local variable binding.
So it seems the problem is caused by native compilation itself and
isn't specific to some OS.

Mew is large package which consists of 65 .el files. So it is
difficult to narrow down the problem. To reproduce the problem you
need to install Mew and make minimal configration according the manual
of Mew (http://www.mew.org/en/info/release/).

Assuming that you completed the installation and configuration of Mew,
There are 2 cases that can be certainly reproduced.

[Case 1]

A. Steps to reproduce the problem

1. Start mew with 'M-x mew'.
2. Depending on the personal configuration, it changes which folder is
   visited just after the startup. Typically you see '+inbox'
   folder. If so you can skip this step. Otherwise switch to '+inbox'
   by typing "g", "+inbox" and return key.
3. At the '+inbox' folder, type 's' and return key.
   (Depending on the configuration you may need to type password.)

B. Expected behavior

Newly arrived message are displayed in "Mew: +inbox" buffer.
(If new message isn't arrived there is no change in "Mew: +inbox"
buffer.)

C. What really happens

Following error message is displayed in the echo area.

"error in process sentinel: Invalid function: mew-filter"

[Case 2]

A. Steps to reproduce the problem

1. Start mew with 'M-x mew'.
2. Type "w". Then buffer to compose new message is displayed.
3. Fill out To:, Subject:, message body, etc.
4. Type C-c C-m.

B. Expected behavior

Message such as following is displayed in the echo area.

"+draft/1 has been queued to +queue/1 (from Draft mode)"

And switch back to the folder before the step 2.

C. What really happens

"nil" is displayed in the echo area and don't switch back to the folder
before the step 2.


In GNU Emacs 28.0.50 (build 1, amd64-portbld-freebsd13.0)
Repository revision: 3572613
Repository branch: master
System Description: 13.0-RELEASE-p4

Configured using:
 'configure --disable-build-details --localstatedir=/var
 --without-libsystemd --without-selinux --with-sound=no
 --with-x-toolkit=no --without-cairo --without-dbus --without-gconf
 --without-gif --without-gsettings --without-imagemagick
 --without-jpeg --without-lcms2 --without-libotf --without-m17n-flt
 --without-png --without-rsvg --without-tiff
 --without-toolkit-scroll-bars --without-x --without-xim --without-xpm
 --without-xwidgets --enable-acl --without-cairo --without-dbus
 --without-gconf --without-gif --with-gnutls --without-gsettings
 --without-harfbuzz --without-jpeg --with-json
 --with-file-notification=kqueue --without-lcms2 --without-m17n-flt
 --without-imagemagick --without-mailutils --with-modules
 --with-native-compilation --without-libotf --without-png
 --without-toolkit-scroll-bars --without-rsvg --with-threads
 --without-tiff --without-xft --without-xim --with-xml2 --without-xpm
 --without-xwidgets --with-x-toolkit=no --prefix=/usr/local
 --mandir=/usr/local/man --disable-silent-rules
 --infodir=/usr/local/share/emacs/info/
 --build=amd64-portbld-freebsd13.0 'CFLAGS=-O2 -pipe
 -fstack-protector-strong -isystem /usr/local/include
 -fno-strict-aliasing ' 'CPPFLAGS=-isystem /usr/local/include'
 'LDFLAGS= -L/usr/local/lib/gcc11 -fstack-protector-strong
 -L/usr/local/lib ''

Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE PDUMPER
THREADS XIM ZLIB

Important settings:
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/local/share/emacs/28.0.50/site-lisp/transient hides /usr/local/share/emacs/28.0.50/lisp/transient
/home/yasu/share/emacs/lisp/ruby-mode hides /usr/local/share/emacs/28.0.50/lisp/progmodes/ruby-mode
/usr/local/share/emacs/28.0.50/site-lisp/flim/sasl hides /usr/local/share/emacs/28.0.50/lisp/net/sasl

Features:
(shadow emacsbug sendmail w3m-form w3m-symbol w3m-bookmark pp qp
network-stream mew-varsx mew-unix mew-w3m w3m doc-view image-mode exif
image timezone w3m-hist w3m-fb bookmark-w3m w3m-ems wid-edit
w3m-favicon w3m-image tab-line w3m-proc w3m-util mew-auth mew-config
mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop mew-smtp mew-ssl mew-ssh
mew-net mew-highlight mew-sort mew-fib mew-ext mew-refile mew-demo
mew-attach mew-draft mew-message mew-thread mew-virtual mew-summary4
mew-summary3 mew-summary2 mew-summary mew-search mew-pick mew-passwd
mew-scan mew-syntax mew-bq mew-smime mew-pgp mew-header mew-exec
mew-mark mew-mime mew-edit mew-decode mew-encode mew-cache mew-minibuf
mew-complete mew-addrbook mew-local mew-vars3 mew-vars2 mew-vars
mew-env mew-lang-jp mew-mule3 mew-mule mew-gemacs mew-key mew-func
mew-blvs mew-const mew pcase term/screen term/xterm xterm jka-compr
magit-version yaml-mode tmux mime-setup mail-mime-setup alist
semi-setup path-util apel-ver product semi-def rng-nxml rng-valid
rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode facemenu dom
nxml-util nxml-enc xmltok edmacro kmacro forge-list forge-commands
forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea
forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub
let-alist gnutls forge-notify forge-revnote forge-pullreq forge-issue
forge-topic yaml parse-time iso8601 bug-reference forge-post
markdown-mode color noutline outline forge-repo forge forge-core
forge-db closql emacsql-sqlite advice emacsql emacsql-compiler
url-http url-auth url-gw nsm magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse url-vars magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff diff-mode git-commit
log-edit easy-mmode message rmc puny dired dired-loaddefs rfc822 mml
mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs
auth-source password-cache json map text-property-search time-date
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log magit-core magit-autorevert autorevert
filenotify magit-margin magit-transient magit-process with-editor
shell pcomplete comint ring server ansi-color magit-mode transient
format-spec magit-git comp regexp-opt comp-cstr warnings cl-extra
help-mode tool-bar magit-section cl-seq magit-utils crm subr-x seq
eieio byte-opt bytecomp byte-compile cconv eieio-core cl-macs gv
eieio-loaddefs dash gitignore-mode gitconfig-mode conf-mode rx
gitattributes-mode thingatpt cl-loaddefs cl-lib japan-util iso-transl
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 328603 25793)
 (symbols 48 26450 31)
 (strings 32 94994 4795)
 (string-bytes 1 2888107)
 (vectors 16 56476)
 (vector-slots 8 1017500 70312)
 (floats 8 297 411)
 (intervals 56 382 0)
 (buffers 992 15))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Mon, 30 Aug 2021 21:03:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Yasuhiro Kimura <yasu <at> utahime.org>
Cc: 50285 <at> debbugs.gnu.org
Subject: Re: bug#50285: 28.0.50; Mew dosen't work correctly if .el files of
 Mew are native compiled
Date: Mon, 30 Aug 2021 17:02:08 -0400
> Following error message is displayed in the echo area.
> "error in process sentinel: Invalid function: mew-filter"

This error message indicates that a call to `mew-filter` was compiled as
a function call, while `mew-filter` is a macro.  This happens when
`mew-filter` is not defined at the time the call is compiled by
`bytecomp.el`.

When this problem shows up in a `.elc` file it means the `.elc` file was
miscompiled and the fault is usually attributed to the source code's
failure to make sure the macro was defined (e.g. by using (require 'mew-func)
somewhere earlier in the file).

In the present case, IIUC the `.elc` file itself is correct because
Mew's makefile compensates for the lack of (require 'mew-func) by using
an ad-hoc compilation script that makes sure the right files
(e.g. `mew-func`) are loaded as needed before the compilation of the
relevant code.

But the `.eln` file is not because when generating the `.eln` our code
starts again from the `.el` file and passes it again to `bytecomp.el`
but this time it's done outside of the control of the makefile, and it
so happens that `mew-func.el` was not loaded before compiling (again)
that call to `mew-filter`.

So we really have 3 problems here:

1- The code in Mew should not rely on the makefile rule for
   correct compilation.
   Fixing this would also make it easier to distribute Mew via ELPA
   (where a similar problem shows up since package.el will compile the
   .el files in an unspecified order which could thus result in the
   same kind of miscompilation).

2- The generation of the `.eln` file should start from the `.elc` file
   rather than from the `.el` file because we sometimes lack the
   information needed to correctly re-generate the `.elc` file from the
   `.el` file.


-- Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Tue, 31 Aug 2021 12:06:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: yasu <at> utahime.org, 50285 <at> debbugs.gnu.org
Subject: Re: bug#50285: 28.0.50;
 Mew dosen't work correctly if .el files of Mew are native compiled
Date: Tue, 31 Aug 2021 15:05:14 +0300
> Cc: 50285 <at> debbugs.gnu.org
> Date: Mon, 30 Aug 2021 17:02:08 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> So we really have 3 problems here:
> 
> 1- The code in Mew should not rely on the makefile rule for
>    correct compilation.
>    Fixing this would also make it easier to distribute Mew via ELPA
>    (where a similar problem shows up since package.el will compile the
>    .el files in an unspecified order which could thus result in the
>    same kind of miscompilation).
> 
> 2- The generation of the `.eln` file should start from the `.elc` file
>    rather than from the `.el` file because we sometimes lack the
>    information needed to correctly re-generate the `.elc` file from the
>    `.el` file.

And 3?...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Tue, 31 Aug 2021 19:02:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: yasu <at> utahime.org, 50285 <at> debbugs.gnu.org
Subject: Re: bug#50285: 28.0.50; Mew dosen't work correctly if .el files of
 Mew are native compiled
Date: Tue, 31 Aug 2021 15:01:44 -0400
Eli Zaretskii [2021-08-31 15:05:14] wrote:

>> Cc: 50285 <at> debbugs.gnu.org
>> Date: Mon, 30 Aug 2021 17:02:08 -0400
>> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> So we really have 3 problems here:
>> 
>> 1- The code in Mew should not rely on the makefile rule for
>>    correct compilation.
>>    Fixing this would also make it easier to distribute Mew via ELPA
>>    (where a similar problem shows up since package.el will compile the
>>    .el files in an unspecified order which could thus result in the
>>    same kind of miscompilation).
>> 
>> 2- The generation of the `.eln` file should start from the `.elc` file
>>    rather than from the `.el` file because we sometimes lack the
>>    information needed to correctly re-generate the `.elc` file from the
>>    `.el` file.
>
> And 3?...

The third problem is the well-known off-by-one,


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Tue, 30 Nov 2021 17:07:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Yasuhiro Kimura <yasu <at> utahime.org>
Cc: 50285 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#50285: 28.0.50; Mew dosen't work correctly if .el files of
 Mew are native compiled
Date: Tue, 30 Nov 2021 17:05:59 +0000
Yasuhiro Kimura <yasu <at> utahime.org> writes:

> Mew is a mail reader for Emacs (http://www.mew.org/). While testing
> native compilation with FreeBSD amd64, I faced the problem that Mew
> doesn't work correctly if .el files of Mew are native compiled.
>
> I reported the problem to mailing list of Mew and recieved a reply
> that Debian also faces it and works it around by setting
> 'no-native-compile' variable to 't' as file-local variable binding.
> So it seems the problem is caused by native compilation itself and
> isn't specific to some OS.

Hi Yasuhiro,

was the missing require issue fixed upstream in the package?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50285; Package emacs. (Mon, 22 Aug 2022 19:03:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yasuhiro Kimura <yasu <at> utahime.org>
Cc: 50285 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#50285: 28.0.50; Mew dosen't work correctly if .el files of
 Mew are native compiled
Date: Mon, 22 Aug 2022 21:01:56 +0200
Yasuhiro Kimura <yasu <at> utahime.org> writes:

> Following error message is displayed in the echo area.
>
> "error in process sentinel: Invalid function: mew-filter"

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

The problem here is that, as Stefan said, the Mew files can't be
compiled in a normal fashion, and that also break native-compiling.  The
problem seems to be that mew-local.el doesn't (require 'mew) before
using the `mew-filter' macro, and that breaks things.

So this should be fixed in Mew, and there's nothing to be done on the
Emacs side here, really, and I'm therefore closing this bug report.

(The discussion then went on to whether the native compiler should use
the .elc files instead of the .el files, but that's a different
discussion, I think.)





bug closed, send any further explanations to 50285 <at> debbugs.gnu.org and Yasuhiro Kimura <yasu <at> utahime.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 22 Aug 2022 19:03:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Sep 2022 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 216 days ago.

Previous Next


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