Subject: bug#71367: 30.0.50; ELPA package breadcrumb causes Emacs freeze when editing json file

From: Andrea Corallo <[email-masked]>
Date: Tue, 04 Jun 2024 16:49:34 -0400

Tassilo Horn <[email-masked]> writes:

> I use and like the breadcrumb ELPA package.
>
>   https://elpa.gnu.org/packages/breadcrumb.html
>
> It's installed/enabled using:
>
> (use-package breadcrumb
>   :ensure t
>   :init (breadcrumb-mode 1))
>
> Now when I find the attached mirrorstatus.json using json-ts-mode (that
> seems to be important), set point on the first { and insert some spaces,
> Emacs will eventually freeze for several seconds or even minutes.
>
> It can be reproduced with
>
>   emacs -Q
>   M-x package-initialize RET
>   M-: (package-activate 'breadcrumb) RET
>   M-x breadcrumb-mode RET
>
> and then finding the file and doing as written above.
>
> I've also attached a gdb backtrace which suggests that emacs is
> collecting garbage (produced by the breadcrumb ELN code)?  I've also
> tried profiler-start, reproduce the freeze, wait for it to go away,
> profiler-report.  That said that 99% of cpu time where spent in
> Automatic GC.
>
> I currently have no emacs without native compilation handy so I cannot
> tell if that's important, too.  Can I somehow tell emacs not to compile
> breadcrumb natively after deleting the eln file?

Hi Tassilo,

yes, you can globally set 'native-comp-jit-compilation' to nil or be
more selective on the files you don't want to be compiled using
'native-comp-jit-compilation'.

Thanks

  Andrea