From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Adam Van Ymeren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Apr 2020 17:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 40907@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15880086648068 (code B ref -1); Mon, 27 Apr 2020 17:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Apr 2020 17:31:04 +0000 Received: from localhost ([127.0.0.1]:38038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7ax-00025T-ES for submit@debbugs.gnu.org; Mon, 27 Apr 2020 13:31:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:56449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7av-00022m-0D for submit@debbugs.gnu.org; Mon, 27 Apr 2020 13:31:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT7au-0002jw-8X for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 13:31:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jT7as-0006lQ-Ro for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 13:30:59 -0400 Received: from mail2.vany.ca ([142.54.190.254]:45576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jT7as-0006l6-CO for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 13:30:58 -0400 Received: from [192.168.1.2] (unknown [192.159.180.39]) by mail2.vany.ca (Postfix) with ESMTPSA id 63983AC016D for ; Mon, 27 Apr 2020 12:30:55 -0500 (CDT) From: Adam Van Ymeren Message-ID: Date: Mon, 27 Apr 2020 17:30:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=142.54.190.254; envelope-from=adam@vany.ca; helo=mail2.vany.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 13:30:55 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 142.54.190.254 X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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)) From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Apr 2020 17:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Adam Van Ymeren , 40907@debbugs.gnu.org Received: via spool by 40907-submit@debbugs.gnu.org id=B40907.158800912313083 (code B ref 40907); Mon, 27 Apr 2020 17:39:01 +0000 Received: (at 40907) by debbugs.gnu.org; 27 Apr 2020 17:38:43 +0000 Received: from localhost ([127.0.0.1]:38047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7iM-0003Ow-NY for submit@debbugs.gnu.org; Mon, 27 Apr 2020 13:38:42 -0400 Received: from mail-wm1-f42.google.com ([209.85.128.42]:55516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT7iK-0003Of-TP for 40907@debbugs.gnu.org; Mon, 27 Apr 2020 13:38:41 -0400 Received: by mail-wm1-f42.google.com with SMTP id e26so520702wmk.5 for <40907@debbugs.gnu.org>; Mon, 27 Apr 2020 10:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=18rByT/hiLMrWQcMTmGEXSUr9JVZ8fwzlyupVr++rlQ=; b=FHlk0D+wqZK/O8SkI69ti/TtouWQw5JYGQcjf3UDnidtPVMtP6fWsclnPjy8+iY5/3 nSTqYb4ZHESf+XZySJvxxyS8NxKtOqnJrkzRSVlfwTJOZ4JzBHKjOf2Qrhc7rTl6cVF2 uzO10wcphiBZIu0iP8yun2LDxmt/iHwQwXH6zrIzD6hHPm2c0NRQbHSBrF4L7xYORKDf LZN8gIMN0kyrhXg7RGq8jR83vOJoNlbFRou2kxQr+sE0sHL+O9HJhXScGtlT+qieu85v HjEK8CvNNv6cAdibjLJuu9mYpqoJzYIjKJ2//AhpAoczZdjnoHv2xdmDiaeDWPXkUicn YHbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=18rByT/hiLMrWQcMTmGEXSUr9JVZ8fwzlyupVr++rlQ=; b=jmK/KMMcxiyK4XijWN5pPo7t2txa8psZW8zlQ3Qyd6RXO2XvOiNkyxBmdm8a147xmS WR/wnpWUMivot6xU+oskGWooFrA/RYu7Cmnszij4/WG28UlOP8qD4IuDZYdfhNuBAt8E wIXr8aAe/LFCugPaVYCo8xe0DkA8ZCrrCugm/bTeJDatkLTkUiL4Hc0dAwdaxdZbbXIb jH3SRA6Hzu5g0Ix8EdYoRLw/ToXPvts5tIG0w0n4ATi14fkN6kA/qVWRvK+8QNHqDkzw xywIsImA/21cxyvdSgDhA94LmSPjk2ZKgP0OCtivbtmlQi1OxGQUIPKtUC8NBgUJ5E6c GK+A== X-Gm-Message-State: AGi0PuZndD06JAkBnGfo4S9SLlkhWxGUgK05uKtbnAsOMNHM4VzzmF9F T0pKn2bzPw6ldhVHxwc1yNPl1zkBvew= X-Google-Smtp-Source: APiQypIB+Zazsu9ngh08h9p7mCbJTLRxKb2gmVS+srs9mA03oW/wZoY/RcyGWSP1D1Qg4/1w9s0vZw== X-Received: by 2002:a1c:3c87:: with SMTP id j129mr561998wma.157.1588009114651; Mon, 27 Apr 2020 10:38:34 -0700 (PDT) Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id y9sm15647930wmm.26.2020.04.27.10.38.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Apr 2020 10:38:33 -0700 (PDT) References: From: Dmitry Gutov Message-ID: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> Date: Mon, 27 Apr 2020 20:38:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 27.04.2020 20:30, Adam Van Ymeren wrote: > 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? You can send the USR2 signal to the Emacs process to try to interrupt what it's doing and enter the debugger: kill -SIGUSR2 To fix this, we'll most likely need the contents of the buffer that has the problem. If it's proprietary, you could try recreating the problem from scratch, or replacing all identifiers in the code with something else, etc. You could also try a build of Emacs 27 first before doing all that. From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Adam Van Ymeren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Apr 2020 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , 40907@debbugs.gnu.org Received: via spool by 40907-submit@debbugs.gnu.org id=B40907.158801167417353 (code B ref 40907); Mon, 27 Apr 2020 18:22:02 +0000 Received: (at 40907) by debbugs.gnu.org; 27 Apr 2020 18:21:14 +0000 Received: from localhost ([127.0.0.1]:38080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT8NV-0004Vo-Pr for submit@debbugs.gnu.org; Mon, 27 Apr 2020 14:21:14 -0400 Received: from mail2.vany.ca ([142.54.190.254]:34260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT8NT-0004Ve-FY for 40907@debbugs.gnu.org; Mon, 27 Apr 2020 14:21:12 -0400 Received: from [192.168.1.2] (unknown [192.159.180.39]) by mail2.vany.ca (Postfix) with ESMTPSA id 1D32AAC016D; Mon, 27 Apr 2020 13:21:10 -0500 (CDT) References: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> From: Adam Van Ymeren Message-ID: Date: Mon, 27 Apr 2020 18:21:09 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2020-04-27 5:38 p.m., Dmitry Gutov wrote: > On 27.04.2020 20:30, Adam Van Ymeren wrote: >> 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? > > You can send the USR2 signal to the Emacs process to try to interrupt > what it's doing and enter the debugger: > > kill -SIGUSR2 > > To fix this, we'll most likely need the contents of the buffer that > has the problem. If it's proprietary, you could try recreating the > problem from scratch, or replacing all identifiers in the code with > something else, etc. > > You could also try a build of Emacs 27 first before doing all that. Wow SIGUSR2 is magical, thanks for that tip.  I reproduced it once visiting a particular file but it's not happening reliably for me now.  Below is the stacktrace and the contents of the associated buffer, but it's not reproducing reliably.  Now that I know about SIGUSR2 I'll report back with a reliable repro once I figure one out. Here's the emacs stacktrace: Debugger entered--entering a function: * #f(compiled-function () #)()   c-parse-state()   c-syntactic-skip-backward("^;{}" 5344 t)   c-fl-decl-start(5927)   c-context-expand-fl-region(5927 6427)   #f(compiled-function (fn) #)(c-context-expand-fl-region)   mapc(#f(compiled-function (fn) #) (c-context-expand-fl-region))   c-before-context-fl-expand-region(5927 6427)   c-font-lock-fontify-region(5927 6427 nil)   font-lock-fontify-region(5927 6427)   #f(compiled-function (fun) #)(font-lock-fontify-region)   run-hook-wrapped(#f(compiled-function (fun) #) font-lock-fontify-region)   jit-lock--run-functions(5927 6427)   jit-lock-fontify-now(5927 6427)   jit-lock-function(5927)   redisplay_internal\ \(C\ function\)() And the buffer contents are given after ==== =============== /**  * @license  * Copyright 2017 The FOAM Authors. All Rights Reserved.  * http://www.apache.org/licenses/LICENSE-2.0  */ package foam.dao; import foam.core.*; import foam.dao.index.*; import foam.mlang.order.Comparator; import foam.mlang.predicate.Or; import foam.mlang.predicate.Predicate; import foam.mlang.sink.GroupBy; import foam.nanos.logger.Logger; import foam.nanos.pm.PM; import java.util.ArrayList; import java.util.List; import java.util.HashSet; import java.util.Set; /**  The MDAO class for an ordering, fast lookup, single value,  index multiplexer, or any other MDAO select() assistance class.  The assitance class TreeIndex implements the  data nodes that hold the indexed items and plan and execute  queries. For any particular operational Index, there may be  many IndexNode instances:  

  1---------> TreeIndex(id)

  MDAO: AltIndex 2---------> TreeIndex(propA) ---> TreeIndex(id) -------------> ValueIndex

  | 1x AltIndexNode    | 1x TreeIndexNode    | 14x TreeIndexNodes         | (DAO size)x ValueIndexNodes

  (2 alt subindexes)     (14 nodes)             (each has 0-5 nodes)

  
 The base AltIndex has two complete subindexes (each holds the entire DAO).  The TreeIndex on property A has created one TreeIndexNode, holding one tree of 14 nodes.  Each tree node contains a tail instance of the next level down, thus  the TreeIndex on id has created 14 TreeIndexNodes. Each of those contains some number  of tree nodes, each holding one tail instance of the ValueIndex at the end of the chain.  */  // TODO: clone and freeze objects stored in memory public class MDAO   extends AbstractDAO {   protected AltIndex index_;   protected Object   state_ = null;   protected Object   writeLock_ = new Object();   protected Set      unindexed_ = new HashSet();   public MDAO(ClassInfo of) {     setOf(of);     index_ = new AltIndex(new TreeIndex((PropertyInfo) this.of_.getAxiomByName("id")));   }   public void addIndex(Index index) {     synchronized ( writeLock_ ) {       state_ = index_.addIndex(state_, index);     }   }   /** Add an Index which is for a unique value. Use addIndex() if the index is not unique. **/   public void addUniqueIndex(PropertyInfo... props) {     Index i = ValueIndex.instance();     for ( PropertyInfo prop : props ) i = new TreeIndex(prop, i);     addIndex(i);   }   /** Add an Index which is for a non-unique value. The 'id' property is    * appended to property list to make it unique.    **/   public void addIndex(PropertyInfo... props) {     Index i = new TreeIndex((PropertyInfo) this.of_.getAxiomByName("id"));     for ( PropertyInfo prop : props ) i = new TreeIndex(prop, i);     addIndex(i);   }   synchronized Object getState() {     return state_;   }   synchronized void setState(Object state) {     state_ = state;   }   public FObject objIn(FObject obj) {     return obj.fclone().freeze();   }   public FObject objOut(FObject obj) {     return obj;   }   public FObject put_(X x, FObject obj) {     // Clone and freeze outside of lock to minimize time spent under lock     obj = objIn(obj);     synchronized ( writeLock_ ) {       FObject oldValue = find_(x, obj);       Object  state    = getState();       if ( oldValue != null ) {         state = index_.remove(state, oldValue);       }       setState(index_.put(state, obj));     }     onPut(obj);     return obj;   }   public FObject remove_(X x, FObject obj) {     if ( obj == null ) return null;     FObject found;     synchronized ( writeLock_ ) {       found = find_(x, obj);       if ( found != null ) {         setState(index_.remove(getState(), found));       }     }     if ( found != null ) {       onRemove(found);     }     return found;   }   public FObject find_(X x, Object o) {     Object state;     state = getState();     if ( o == null ) return null;     // TODO: PM unindexed plans     return objOut(       getOf().isInstance(o)         ? (FObject) index_.planFind(state, getPrimaryKey().get(o)).find(state, getPrimaryKey().get(o))         : (FObject) index_.planFind(state, o).find(state, o)     );   }   public Sink select_(X x, Sink sink, long skip, long limit, Comparator order, Predicate predicate) {     Logger     logger = (Logger) x.get("logger");     SelectPlan plan;     Predicate  simplePredicate = null;     PM         pm = null;     // use partialEval to wipe out such useless predicate such as: And(EQ()) ==> EQ(), And(And(EQ()),GT()) ==> And(EQ(),GT())     if ( predicate != null ) simplePredicate = predicate.partialEval();     Object state = getState();     // We handle OR logic by seperate request from MDAO. We return different plan for each parameter of OR logic.     if ( simplePredicate instanceof Or ) {       Sink dependSink = new ArraySink();       // When we have groupBy, order, skip, limit such requirement, we can't do it separately so I replace a array sink to temporarily holde the whole data       //Then after the plan wa slelect we change it to the origin sink       int length = ((Or) simplePredicate).getArgs().length;       List planList = new ArrayList<>();       for ( int i = 0 ; i < length ; i++ ) {         Predicate arg = ((Or) simplePredicate).getArgs()[i];         planList.add(index_.planSelect(state, dependSink, 0, AbstractDAO.MAX_SAFE_INTEGER, null, arg));       }       plan = new OrPlan(simplePredicate, planList);     } else {       plan = index_.planSelect(state, sink, skip, limit, order, simplePredicate);     }     if ( state != null && predicate != null && plan.cost() > 10 && plan.cost() >= index_.size(state) ) {       pm = new PM(this.getClass(), "MDAO:UnindexedSelect:" + getOf().getId());       if ( ! unindexed_.contains(getOf().getId())) {         if ( ! predicate.equals(simplePredicate) &&              logger != null ) {             logger.debug(String.format("The original predicate was %s but it was simplified to %s.", predicate.toString(), simplePredicate.toString()));         }         unindexed_.add(getOf().getId());         if ( logger != null ) {           logger.warning("Unindexed search on MDAO", getOf().getId(), simplePredicate.toString());         }       }     }     plan.select(state, sink, skip, limit, order, simplePredicate);     if ( pm != null ) pm.log(x);     sink.eof();     return sink;   }   public void removeAll_(X x, long skip, long limit, Comparator order, Predicate predicate) {     if ( predicate == null && skip == 0 && limit == MAX_SAFE_INTEGER ) {       synchronized ( writeLock_ ) {         setState(null);       }     } else {       super.removeAll_(x, skip, limit, order, predicate);     }   } } From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Apr 2020 18:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Adam Van Ymeren Cc: 40907@debbugs.gnu.org, Dmitry Gutov Received: via spool by 40907-submit@debbugs.gnu.org id=B40907.158818540413632 (code B ref 40907); Wed, 29 Apr 2020 18:37:01 +0000 Received: (at 40907) by debbugs.gnu.org; 29 Apr 2020 18:36:44 +0000 Received: from localhost ([127.0.0.1]:44570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTrZb-0003Xn-PY for submit@debbugs.gnu.org; Wed, 29 Apr 2020 14:36:44 -0400 Received: from colin.muc.de ([193.149.48.1]:59103 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jTrZY-0003XX-9K for 40907@debbugs.gnu.org; Wed, 29 Apr 2020 14:36:41 -0400 Received: (qmail 56104 invoked by uid 3782); 29 Apr 2020 18:36:38 -0000 Received: from acm.muc.de (p4FE15DE7.dip0.t-ipconnect.de [79.225.93.231]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Wed, 29 Apr 2020 20:36:37 +0200 Received: (qmail 10754 invoked by uid 1000); 29 Apr 2020 18:36:37 -0000 Date: Wed, 29 Apr 2020 18:36:37 +0000 Message-ID: <20200429183637.GA10680@ACM> References: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Adam. On Mon, Apr 27, 2020 at 18:21:09 +0000, Adam Van Ymeren wrote: > On 2020-04-27 5:38 p.m., Dmitry Gutov wrote: > > On 27.04.2020 20:30, Adam Van Ymeren wrote: > >> 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? > > You can send the USR2 signal to the Emacs process to try to interrupt > > what it's doing and enter the debugger: > > kill -SIGUSR2 > > To fix this, we'll most likely need the contents of the buffer that > > has the problem. If it's proprietary, you could try recreating the > > problem from scratch, or replacing all identifiers in the code with > > something else, etc. > > You could also try a build of Emacs 27 first before doing all that. > Wow SIGUSR2 is magical, thanks for that tip.  I reproduced it once > visiting a particular file but it's not happening reliably for me now.  > Below is the stacktrace and the contents of the associated buffer, but > it's not reproducing reliably.  Now that I know about SIGUSR2 I'll > report back with a reliable repro once I figure one out. The buffer copy you sent looks corrupted - it contains lots of non-breaking spaces (or are these intended?) and it seems to be double-spaced all the way through. If it is corrupted, is there any chance you could post a clean version, possibly by attaching it to your email? With that, there's a good chance your stack trace will be enough to be able to debug this. There's also a good chance the bug has already been diagnosed and fixed (for the upcoming Emacs-27.1), but it will need some effort to verify this. > Here's the emacs stacktrace: [ Double spacing removed from this ... ] > Debugger entered--entering a function: > * #f(compiled-function () #)() >   c-parse-state() >   c-syntactic-skip-backward("^;{}" 5344 t) >   c-fl-decl-start(5927) >   c-context-expand-fl-region(5927 6427) >   #f(compiled-function (fn) #)(c-context-expand-fl-region) >   mapc(#f(compiled-function (fn) #) (c-context-expand-fl-region)) >   c-before-context-fl-expand-region(5927 6427) >   c-font-lock-fontify-region(5927 6427 nil) >   font-lock-fontify-region(5927 6427) >   #f(compiled-function (fun) #)(font-lock-fontify-region) >   run-hook-wrapped(#f(compiled-function (fun) #) font-lock-fontify-region) >   jit-lock--run-functions(5927 6427) >   jit-lock-fontify-now(5927 6427) >   jit-lock-function(5927) >   redisplay_internal\ \(C\ function\)() > And the buffer contents are given after ==== > =============== > /** >  * @license >  * Copyright 2017 The FOAM Authors. All Rights Reserved. >  * http://www.apache.org/licenses/LICENSE-2.0 >  */ > package foam.dao; > import foam.core.*; > import foam.dao.index.*; [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Aug 2021 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: Adam Van Ymeren , 40907@debbugs.gnu.org, Dmitry Gutov Received: via spool by 40907-submit@debbugs.gnu.org id=B40907.16286111802248 (code B ref 40907); Tue, 10 Aug 2021 16:00:02 +0000 Received: (at 40907) by debbugs.gnu.org; 10 Aug 2021 15:59:40 +0000 Received: from localhost ([127.0.0.1]:60538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUAG-0000aC-AI for submit@debbugs.gnu.org; Tue, 10 Aug 2021 11:59:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUAE-0000Zx-8P for 40907@debbugs.gnu.org; Tue, 10 Aug 2021 11:59:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YNauun8kF8HvDxJ7PguY3bQaZ5yycmHhSiGyJw4Xfe0=; b=Sq2YgXddDDtZj3gb0NCIMwy18N A+irSiP5K1TDjioTQkqfHnc6wV/mIEO6k8eZAflASfQPx5hOXfy1F5tVhlb8YccZQz5o/zttVb7hU xM9fsxhRqXzhPLcGQMqjjQVDK3E6PK7NQ45aFuwaS5zkoXS8NqDoIsZy1a5LjbNOQaoQ=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDUA3-0003ny-TO; Tue, 10 Aug 2021 17:59:32 +0200 From: Lars Ingebrigtsen References: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> <20200429183637.GA10680@ACM> Date: Tue, 10 Aug 2021 17:59:26 +0200 In-Reply-To: <20200429183637.GA10680@ACM> (Alan Mackenzie's message of "Wed, 29 Apr 2020 18:36:37 +0000") Message-ID: <87wnotwash.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > The buffer copy you sent looks corrupted - it contains lots of > non-breaking spaces (or are these intended?) and it seems to be > double-spaced all the way through. If it is corrupted, is there any [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > The buffer copy you sent looks corrupted - it contains lots of > non-breaking spaces (or are these intended?) and it seems to be > double-spaced all the way through. If it is corrupted, is there any > chance you could post a clean version, possibly by attaching it to your > email? More information was requested, but no response was given within a year, so I'm closing this bug report. If the problem still exists, please respond to this email and we'll reopen the bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 11:59:44 2021 Received: (at control) by debbugs.gnu.org; 10 Aug 2021 15:59:44 +0000 Received: from localhost ([127.0.0.1]:60541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUAK-0000aS-HW for submit@debbugs.gnu.org; Tue, 10 Aug 2021 11:59:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUAJ-0000a2-5J for control@debbugs.gnu.org; Tue, 10 Aug 2021 11:59:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5JRB5N9YMlFJKYy5mINYuxONxBPaVrKRJaXJougBonY=; b=R6K+iYZZasqGMuE+xG5VXaJ5As oIUIOVQ347odnZxJ1OBwHIJc8E4eC1Y/NVax/6D/hWjchCKg9sbhFsHF+YQL4WRMuRN7Wv8WcpVyC sW1reCiw2pEls8s4bvKC6y4cn3gcJkRIzyR6Epl3Qmo2PPKccJYalXu6oxwOU+my+j+s=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDUAB-0003o8-7x for control@debbugs.gnu.org; Tue, 10 Aug 2021 17:59:37 +0200 Date: Tue, 10 Aug 2021 17:59:34 +0200 Message-Id: <87v94dwas9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40907 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 40907 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 40907 quit From unknown Sat Jun 14 14:27:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40907: Font-lock-mode hanging in Java buffers Resent-From: Adam Van Ymeren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Aug 2021 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: Alan Mackenzie , 40907@debbugs.gnu.org, Dmitry Gutov Received: via spool by 40907-submit@debbugs.gnu.org id=B40907.16286146979669 (code B ref 40907); Tue, 10 Aug 2021 16:59:02 +0000 Received: (at 40907) by debbugs.gnu.org; 10 Aug 2021 16:58:17 +0000 Received: from localhost ([127.0.0.1]:60764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDV4v-0002Vn-8T for submit@debbugs.gnu.org; Tue, 10 Aug 2021 12:58:17 -0400 Received: from georgie.vany.ca ([198.27.65.197]:59656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDV4p-0002Va-62 for 40907@debbugs.gnu.org; Tue, 10 Aug 2021 12:58:11 -0400 Received: from dummy.faircode.eu (unknown [72.143.222.237]) by georgie.vany.ca (Postfix) with ESMTPSA id C1AB81C0119; Tue, 10 Aug 2021 12:58:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vany.ca; s=2020; t=1628614686; bh=2zPowOmFG5/6dFMrva53agH3VUg5Gg24H25NQvMM2CA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=V4W7uLV1+DCboX/hg9Tzd84As3P9Mh6C4Vtk2j3pyq+n3m/oQGcqFhJiSF7sN2V1U 3SRjYIpJh09BKrZySfeMEU4iozO2TC0JpaE/BGOj92sg3ML0iyjR/LjNymtt+tUcbQ QfQEf61TSyafz4XZqvd9gprEwNgyHwpZCN7yGXeuqwS63XyJoF885jkfMm98PopaTF kgu7OV3pOe8FTA5Pfa/bzSq/D0bPOMFafxXa6f/rDeGF8MpyJx6mVafrTdwzlzWWZg 9zyjLRQx5pIrLbpbQ8DDgJhFqP4XUEk7iiONH6yjf034DI1sbpOX6HfE+d4Ai2hfWr Gw8/1Lzz6U58A== Date: Tue, 10 Aug 2021 16:58:03 +0000 (UTC) From: Adam Van Ymeren Message-ID: <2470c081-567c-491a-87c7-8f1417fe7517@vany.ca> In-Reply-To: <87wnotwash.fsf@gnus.org> References: <215d8224-219b-ad06-ba4a-f99250e0a56d@yandex.ru> <20200429183637.GA10680@ACM> <87wnotwash.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <2470c081-567c-491a-87c7-8f1417fe7517@vany.ca> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yeah I lost track sorry.=C2=A0 Couldn't get a minimal repo case, if I hit i= t again I will file a better report.=C2=A0 Sorry for ghosting! Aug 10, 2021 8:59:36 AM Lars Ingebrigtsen : > Alan Mackenzie writes: >=20 >> The buffer copy you sent looks corrupted - it contains lots of >> non-breaking spaces (or are these intended?) and it seems to be >> double-spaced all the way through.=C2=A0 If it is corrupted, is there an= y >> chance you could post a clean version, possibly by attaching it to your >> email? >=20 > More information was requested, but no response was given within a > year, so I'm closing this bug report.=C2=A0 If the problem still exists, > please respond to this email and we'll reopen the bug report. >=20 > -- > (domestic pets only, the antidote for overdose, milk.) > =C2=A0=C2=A0 bloggy blog: http://lars.ingebrigtsen.no