Subject: bug#40907: Font-lock-mode hanging in Java buffers

From: Adam Van Ymeren <[email-masked]>
Date: Mon, 27 Apr 2020 17:30:53 +0000

I've been doing a lot of Java work lately, and I'm having issues with 
emacs hanging and spinning at 100% CPU.  I believe the culprit to be 
font-lock-mode.  C-g doesn't save me either, I usually have to kill 
emacs.  Any advice on how to debug this if C-g doesn't work?

Below is the contents of M-x report-emacs-bug if relevant.  This is a 
custom trisquel emacs package I built using unmodified upstream 26.3 
sources.

Thanks!

-Adam

In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
  of 2020-03-27 built on gus
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:    Trisquel GNU/Linux 8.0, Flidas

Configured using:
  'configure --build=x86_64-linux-gnu --prefix=/usr
  '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
  '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
  --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
  '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
  --disable-dependency-tracking --with-modules --with-xwidgets 'CFLAGS=-g
  -O2 -fstack-protector-strong -Wformat -Werror=format-security'
  'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
  'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2

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

Major mode: Dired by name

Minor modes in effect:
   diff-auto-refine-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-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:
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides 
/usr/share/emacs/26.3/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides 
/usr/share/emacs/26.3/lisp/textmodes/flyspell
/home/adam2/.emacs.d/elpa/let-alist-1.0.6/let-alist hides 
/usr/share/emacs/26.3/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug sendmail ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff diary-lib
diary-loaddefs cal-iso org-rmail org-mhe org-irc org-info org-gnus nnir
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec epa derived epg mm-decode
mm-bodies mailabbrev gmm-utils mailheader gnus-win gnus nnheader
gnus-util rmail rmail-loaddefs mail-utils wid-edit org-docview doc-view
jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m org-agenda
vc-git diff-mode misearch multi-isearch dired-aux warnings hywconfig
cl-extra help-mode elec-pair ob-js base16-solarized-light-theme
base16-theme esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg
esh-groups eshell esh-module esh-mode esh-util erc-goodies erc
erc-backend erc-compat ob-screen ob-java js sgml-mode dom imenu
thingatpt cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs ediprolog hyperbole hinit hibtypes hib-doc-id
hsys-www klink hib-kbd hib-social hib-debbugs hsys-org hactypes hui-mini
hui hui-mouse hmouse-key hargs hui-menu hyrolo-menu hyrolo hmail
hui-jmenu hmouse-sh hmouse-drv hypb locate hui-window pulse hycontrol
hsettings hui-em-but hbut hact hpath subr-x hhist hbdata htz cal-julian
hbmap hmoccur hui-select hvar set hversion hload-path exwm-randr
xcb-randr exwm-config ido exwm exwm-input xcb-keysyms xcb-xkb
exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout
exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types
xcb-debug server ox-odt rng-loc rng-uri rng-parse rng-match rng-dt
rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex
ox-icalendar ox-html table ox-ascii ox-publish ox org-element avl-tree
generator org advice org-macro org-footnote org-pcomplete pcomplete
org-list org-faces org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys
ob-comint comint ansi-color ring org-loaddefs cal-menu calendar
cal-loaddefs ob-exp ob-core org-compat ob-eval org-macs format-spec
elnode dired dired-loaddefs db web time-stamp browse-url json map rx s
url-util mailcap mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr fakir dotassoc kv noflet cl-indent cl dash ert pp
find-func ewoc debug finder-inf kotl-autoloads info slime-autoloads
package easymenu epg-config url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq
byte-opt gv bytecomp byte-compile cconv edmacro kmacro cl-loaddefs
cl-lib time-date mule-util 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
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
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
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 486346 46813)
  (symbols 48 56643 2)
  (miscs 40 265 1145)
  (strings 32 145747 8912)
  (string-bytes 1 4635211)
  (vectors 16 67515)
  (vector-slots 8 1265304 32572)
  (floats 8 322 251)
  (intervals 56 2498 406)
  (buffers 992 23)
  (heap 1024 69920 2977))