unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Adam Van Ymeren <adam@vany.ca>
Cc: 40907@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#40907: Font-lock-mode hanging in Java buffers
Date: Wed, 29 Apr 2020 18:36:37 +0000	[thread overview]
Message-ID: <20200429183637.GA10680@ACM> (raw)
In-Reply-To: <ecbcc2f2-cb31-86e8-9273-06647f48153a@vany.ca>

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 <pid>

> > 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 () #<bytecode 0xe5f179>)()
>    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) #<bytecode 0xec98d5>)(c-context-expand-fl-region)
>    mapc(#f(compiled-function (fn) #<bytecode 0xec98d5>) (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) #<bytecode 0x14a42f5>)(font-lock-fontify-region)
>    run-hook-wrapped(#f(compiled-function (fun) #<bytecode 0x14a42f5>) 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).





  reply	other threads:[~2020-04-29 18:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 17:30 bug#40907: Font-lock-mode hanging in Java buffers Adam Van Ymeren
2020-04-27 17:38 ` Dmitry Gutov
2020-04-27 18:21   ` Adam Van Ymeren
2020-04-29 18:36     ` Alan Mackenzie [this message]
2021-08-10 15:59       ` Lars Ingebrigtsen
2021-08-10 16:58         ` Adam Van Ymeren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429183637.GA10680@ACM \
    --to=acm@muc.de \
    --cc=40907@debbugs.gnu.org \
    --cc=adam@vany.ca \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).