GNU bug report logs - #48097
28.0.50; C code not being correctly fontified in features/native-comp

Previous Next

Package: emacs;

Reported by: Alex Bennée <alex.bennee <at> linaro.org>

Date: Thu, 29 Apr 2021 10:15:01 UTC

Severity: normal

Found in version 28.0.50

Done: Eli Zaretskii <eliz <at> gnu.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 48097 in the body.
You can then email your comments to 48097 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#48097; Package emacs. (Thu, 29 Apr 2021 10:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Bennée <alex.bennee <at> linaro.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 29 Apr 2021 10:15:02 GMT) Full text and rfc822 format available.

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

From: Alex Bennée <alex.bennee <at> linaro.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; C code not being correctly fontified in features/native-comp
Date: Thu, 29 Apr 2021 11:14:44 +0100
This happens with a lot of C files but for a concrete reproducible
example from my development repository:

  https://github.com/stsquad/qemu/blob/review/qtest-accel-check-v4/tests/qtest/arm-cpu-features.c

Running:

  emacs -Q tests/qtest/arm-cpu-features.c

And witness the lack of fontification from half way through assert_error
although resp_has_props seems to recover for the function prototype and
initial variable. When I run:

 M-x font-lock-debug-fontify

The fontification fixes itself although I get a bunch of errors in
Messages:

  Error during redisplay: (jit-lock-function 2666) signaled (wrong-type-argument number-or-marker-p nil)
  Error during redisplay: (jit-lock-function 3125) signaled (wrong-type-argument number-or-marker-p nil)

In GNU Emacs 28.0.50 (build 4, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-04-24 built on zen
Repository revision: fa65c044f2ebe666467166075c1507a8d0e1347f
Repository branch: feature/native-comp
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --with-x-toolkit=lucid --prefix=/home/alex/src/emacs/install
 --with-modules --with-imagemagick --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  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
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug comp comp-cstr warnings rx cl-extra
help-mode message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa
derived epg epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json map
text-property-search seq byte-opt gv bytecomp byte-compile cconv
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils time-date subr-x vc-git diff-mode easy-mmode vc-dispatcher
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs cl-loaddefs cl-lib iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar 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 dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
x multi-tty make-network-process nativecomp emacs)

Memory information:
((conses 16 131404 9363)
 (symbols 48 10101 1)
 (strings 32 29919 2259)
 (string-bytes 1 1072854)
 (vectors 16 18858)
 (vector-slots 8 322162 14264)
 (floats 8 31 33)
 (intervals 56 2086 0)
 (buffers 992 13))

-- 
Alex Bennée
QEMU/KVM Hacker for Linaro




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 10:35:01 GMT) Full text and rfc822 format available.

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

From: Alex Bennée <alex.bennee <at> linaro.org>
To: 48097 <at> debbugs.gnu.org
Date: Thu, 29 Apr 2021 11:34:39 +0100
[Message part 1 (text/plain, inline)]
I suspect this might be a duplicate of #48061 - re-building with the
current master the bug has gone away and problems with c-mode cause by
strange code would certainly explain it.

-- 
Alex Bennée
KVM/QEMU Hacker for Linaro
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 12:18:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Alex Bennée <alex.bennee <at> linaro.org>
Cc: 48097 <at> debbugs.gnu.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 12:17:43 +0000
Alex Bennée <alex.bennee <at> linaro.org> writes:

> I suspect this might be a duplicate of #48061 - re-building with the current master the bug has gone away and problems
> with c-mode cause by strange code would certainly explain it.

Hi Alex,

okay shall we close this then?

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 12:22:01 GMT) Full text and rfc822 format available.

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

From: Alex Bennée <alex.bennee <at> linaro.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 48097 <at> debbugs.gnu.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 13:21:11 +0100
[Message part 1 (text/plain, inline)]
Yes, please proceed.

On Thu, 29 Apr 2021 at 13:17, Andrea Corallo <akrl <at> sdf.org> wrote:

> Alex Bennée <alex.bennee <at> linaro.org> writes:
>
> > I suspect this might be a duplicate of #48061 - re-building with the
> current master the bug has gone away and problems
> > with c-mode cause by strange code would certainly explain it.
>
> Hi Alex,
>
> okay shall we close this then?
>
>   Andrea
>


-- 
Alex Bennée
KVM/QEMU Hacker for Linaro
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 12:29:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Bennée <alex.bennee <at> linaro.org>
Cc: 48097 <at> debbugs.gnu.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 15:28:11 +0300
> From: Alex Bennée <alex.bennee <at> linaro.org>
> Date: Thu, 29 Apr 2021 11:34:39 +0100
> 
> I suspect this might be a duplicate of #48061 - re-building with the current master the bug has gone away and
> problems with c-mode cause by strange code would certainly explain it.

I still see the problem with the latest master branch, when
natively-compiled Lisp files are used.  I don't see the problem when
using byte-compiled Lisp.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 13:13:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: alex.bennee <at> linaro.org, 48097 <at> debbugs.gnu.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 16:12:05 +0300
> Cc: 48097 <at> debbugs.gnu.org
> Date: Thu, 29 Apr 2021 12:17:43 +0000
> From:  Andrea Corallo via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Alex Bennée <alex.bennee <at> linaro.org> writes:
> 
> > I suspect this might be a duplicate of #48061 - re-building with the current master the bug has gone away and problems
> > with c-mode cause by strange code would certainly explain it.
> 
> Hi Alex,
> 
> okay shall we close this then?

Please don't close yet, I still see the problem.

It is strange that Alex says bug#48061 should solve this: the fix for
that bug changed comp-cstr.el, and I have that natively-compiled after
that change.  Do I need to make sure other files are recompiled, for
example the CC mode files?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 14:27:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alex.bennee <at> linaro.org, 48097 <at> debbugs.gnu.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 14:26:50 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: 48097 <at> debbugs.gnu.org
>> Date: Thu, 29 Apr 2021 12:17:43 +0000
>> From:  Andrea Corallo via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Alex Bennée <alex.bennee <at> linaro.org> writes:
>> 
>> > I suspect this might be a duplicate of #48061 - re-building with the current master the bug has gone away and problems
>> > with c-mode cause by strange code would certainly explain it.
>> 
>> Hi Alex,
>> 
>> okay shall we close this then?
>
> Please don't close yet, I still see the problem.
>
> It is strange that Alex says bug#48061 should solve this: the fix for
> that bug changed comp-cstr.el, and I have that natively-compiled after
> that change.  Do I need to make sure other files are recompiled, for
> example the CC mode files?

Yes, all possibly miscompiled files should be recompiled so at least
"cc-engine.el" were we know for sure `c-determine-limit-no-macro' was
miscompiled.  If the eln corresponding to "cc-engine.el" is in your
"~/.emacs.d/eln-cache" it's probably still the broken one, in this case
should be sufficient remove it and restart Emacs.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48097; Package emacs. (Thu, 29 Apr 2021 14:32:01 GMT) Full text and rfc822 format available.

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

From: Alex Bennée <alex.bennee <at> linaro.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 48097 <at> debbugs.gnu.org, Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 15:31:14 +0100
[Message part 1 (text/plain, inline)]
During my rebuild I did a distclean, wiped the old install directory and
also cleared the eln-cache just to make sure everything was pristine. The
function in question is reported as natively compiled:

c-determine-limit-no-macro is a native compiled Lisp function in
‘cc-engine.el’.

On Thu, 29 Apr 2021 at 14:12, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Cc: 48097 <at> debbugs.gnu.org
> > Date: Thu, 29 Apr 2021 12:17:43 +0000
> > From:  Andrea Corallo via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >
> > Alex Bennée <alex.bennee <at> linaro.org> writes:
> >
> > > I suspect this might be a duplicate of #48061 - re-building with the
> current master the bug has gone away and problems
> > > with c-mode cause by strange code would certainly explain it.
> >
> > Hi Alex,
> >
> > okay shall we close this then?
>
> Please don't close yet, I still see the problem.
>
> It is strange that Alex says bug#48061 should solve this: the fix for
> that bug changed comp-cstr.el, and I have that natively-compiled after
> that change.  Do I need to make sure other files are recompiled, for
> example the CC mode files?
>


-- 
Alex Bennée
KVM/QEMU Hacker for Linaro
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 29 Apr 2021 15:02:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Bennée <alex.bennee <at> linaro.org>:
bug acknowledged by developer. (Thu, 29 Apr 2021 15:02:02 GMT) Full text and rfc822 format available.

Message #31 received at 48097-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 48097-done <at> debbugs.gnu.org, alex.bennee <at> linaro.org
Subject: Re: bug#48097:
Date: Thu, 29 Apr 2021 18:00:45 +0300
> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: alex.bennee <at> linaro.org, 48097 <at> debbugs.gnu.org
> Date: Thu, 29 Apr 2021 14:26:50 +0000
> 
> > Please don't close yet, I still see the problem.
> >
> > It is strange that Alex says bug#48061 should solve this: the fix for
> > that bug changed comp-cstr.el, and I have that natively-compiled after
> > that change.  Do I need to make sure other files are recompiled, for
> > example the CC mode files?
> 
> Yes, all possibly miscompiled files should be recompiled so at least
> "cc-engine.el" were we know for sure `c-determine-limit-no-macro' was
> miscompiled.  If the eln corresponding to "cc-engine.el" is in your
> "~/.emacs.d/eln-cache" it's probably still the broken one, in this case
> should be sufficient remove it and restart Emacs.

OK, after recompiling the CC mode files, the problem is indeed gone.
Closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 May 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 305 days ago.

Previous Next


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