GNU bug report logs - #42522
Emacs 27: 100% CPU when setting mode-name with ligatures

Previous Next

Package: emacs;

Reported by: Evan Moses <emoses <at> gmail.com>

Date: Fri, 24 Jul 2020 22:30:01 UTC

Severity: normal

Done: Stefan Kangas <stefan <at> marxist.se>

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 42522 in the body.
You can then email your comments to 42522 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#42522; Package emacs. (Fri, 24 Jul 2020 22:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evan Moses <emoses <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Jul 2020 22:30:02 GMT) Full text and rfc822 format available.

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

From: Evan Moses <emoses <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs 27: 100% CPU when setting mode-name with ligatures
Date: Fri, 24 Jul 2020 14:35:50 -0700
[Message part 1 (text/plain, inline)]
Emacs version: GNU Emacs 27.0.91 (build 1, x86_64-apple-darwin18.7.0, NS
appkit-1671.60 Version 10.14.6 (Build 18G5033)) of 2020-07-24
Built d5acc509415869bce22c49ae311f2960494a0bdc locally


To reproduce, evaluate this

(set-char-table-range composition-function-table 47
'([".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)" 0 font-shape-gstring]))

And then evaluate

(setq mode-name "test//")

Emacs will become unresponsive and consume 100% CPU.

-- 
Evan Moses
emoses <at> gmail.com
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Sat, 25 Jul 2020 06:26:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Evan Moses <emoses <at> gmail.com>
Cc: 42522 <at> debbugs.gnu.org
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Sat, 25 Jul 2020 09:24:47 +0300
> From: Evan Moses <emoses <at> gmail.com>
> Date: Fri, 24 Jul 2020 14:35:50 -0700
> 
> To reproduce, evaluate this
> 
> (set-char-table-range composition-function-table 47 '([".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)" 0
> font-shape-gstring]))
> 
> And then evaluate 
> 
> (setq mode-name "test//")
> 
> Emacs will become unresponsive and consume 100% CPU.

It doesn't hang here.  Could this be macOS-specific?  Or maybe the
problem happens only with some fonts?  Does it happen in "emacs -Q"?

In any case, did you really mean for Emacs to produce ligatures on the
mode line?  More generally, what kind of ligatures are you trying to
produce with this setup?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Sat, 25 Jul 2020 17:23:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42522 <at> debbugs.gnu.org, Evan Moses <emoses <at> gmail.com>
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Sat, 25 Jul 2020 19:22:19 +0200
>>>>> On Sat, 25 Jul 2020 09:24:47 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Evan Moses <emoses <at> gmail.com>
    >> Date: Fri, 24 Jul 2020 14:35:50 -0700
    >> 
    >> To reproduce, evaluate this
    >> 
    >> (set-char-table-range composition-function-table 47 '([".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)" 0
    >> font-shape-gstring]))
    >> 
    >> And then evaluate 
    >> 
    >> (setq mode-name "test//")
    >> 
    >> Emacs will become unresponsive and consume 100% CPU.

    Eli> It doesn't hang here.  Could this be macOS-specific?  Or maybe the
    Eli> problem happens only with some fonts?  Does it happen in "emacs -Q"?

I see this on macOS with -Q, which uses Menlo, but only with emacs-27,
not master.. I do see an 'Attempt to shape unibyte text' message from
emacs-27

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Sat, 25 Jul 2020 17:29:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 42522 <at> debbugs.gnu.org, emoses <at> gmail.com
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Sat, 25 Jul 2020 20:27:53 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Evan Moses <emoses <at> gmail.com>,  42522 <at> debbugs.gnu.org
> Date: Sat, 25 Jul 2020 19:22:19 +0200
> 
>     Eli> It doesn't hang here.  Could this be macOS-specific?  Or maybe the
>     Eli> problem happens only with some fonts?  Does it happen in "emacs -Q"?
> 
> I see this on macOS with -Q, which uses Menlo, but only with emacs-27,
> not master.. I do see an 'Attempt to shape unibyte text' message from
> emacs-27

Then I guess the problem is already solved on master.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Sat, 25 Jul 2020 22:01:02 GMT) Full text and rfc822 format available.

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

From: Evan Moses <emoses <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42522 <at> debbugs.gnu.org
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Sat, 25 Jul 2020 14:13:17 -0700
[Message part 1 (text/plain, inline)]
FYI I was following the instructions here: https://github.com/tonsky/FiraCode/wiki/Emacs-instructions#using-composition-char-table to get Fira Code ligatures globally. It so happens that C-modes will add “//“ to the mode name in certain configurations; I just pared this down to a minimal repro case. 

--
Evan Moses
emoses <at> gmail.com


> On Jul 24, 2020, at 11:25 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> 
>> 
>> From: Evan Moses <emoses <at> gmail.com>
>> Date: Fri, 24 Jul 2020 14:35:50 -0700
>> 
>> To reproduce, evaluate this
>> 
>> (set-char-table-range composition-function-table 47 '([".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)" 0
>> font-shape-gstring]))
>> 
>> And then evaluate 
>> 
>> (setq mode-name "test//")
>> 
>> Emacs will become unresponsive and consume 100% CPU.
> 
> It doesn't hang here.  Could this be macOS-specific?  Or maybe the
> problem happens only with some fonts?  Does it happen in "emacs -Q"?
> 
> In any case, did you really mean for Emacs to produce ligatures on the
> mode line?  More generally, what kind of ligatures are you trying to
> produce with this setup?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Thu, 13 Aug 2020 00:19:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42522 <at> debbugs.gnu.org, Robert Pluim <rpluim <at> gmail.com>, emoses <at> gmail.com
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Wed, 12 Aug 2020 17:18:15 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Robert Pluim <rpluim <at> gmail.com>
>> Cc: Evan Moses <emoses <at> gmail.com>,  42522 <at> debbugs.gnu.org
>> Date: Sat, 25 Jul 2020 19:22:19 +0200
>>
>>     Eli> It doesn't hang here.  Could this be macOS-specific?  Or maybe the
>>     Eli> problem happens only with some fonts?  Does it happen in "emacs -Q"?
>>
>> I see this on macOS with -Q, which uses Menlo, but only with emacs-27,
>> not master.. I do see an 'Attempt to shape unibyte text' message from
>> emacs-27
>
> Then I guess the problem is already solved on master.

Evan, could you please try this on the current master branch?

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42522; Package emacs. (Thu, 13 Aug 2020 16:19:01 GMT) Full text and rfc822 format available.

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

From: Evan Moses <emoses <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 42522 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Thu, 13 Aug 2020 09:18:13 -0700
[Message part 1 (text/plain, inline)]
Seems to work fine now; Thanks!

On Wed, Aug 12, 2020 at 5:18 PM Stefan Kangas <stefan <at> marxist.se> wrote:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: Robert Pluim <rpluim <at> gmail.com>
> >> Cc: Evan Moses <emoses <at> gmail.com>,  42522 <at> debbugs.gnu.org
> >> Date: Sat, 25 Jul 2020 19:22:19 +0200
> >>
> >>     Eli> It doesn't hang here.  Could this be macOS-specific?  Or maybe
> the
> >>     Eli> problem happens only with some fonts?  Does it happen in
> "emacs -Q"?
> >>
> >> I see this on macOS with -Q, which uses Menlo, but only with emacs-27,
> >> not master.. I do see an 'Attempt to shape unibyte text' message from
> >> emacs-27
> >
> > Then I guess the problem is already solved on master.
>
> Evan, could you please try this on the current master branch?
>
> Best regards,
> Stefan Kangas
>


-- 
Evan Moses
emoses <at> gmail.com
[Message part 2 (text/html, inline)]

Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Thu, 13 Aug 2020 16:55:02 GMT) Full text and rfc822 format available.

Notification sent to Evan Moses <emoses <at> gmail.com>:
bug acknowledged by developer. (Thu, 13 Aug 2020 16:55:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Evan Moses <emoses <at> gmail.com>
Cc: 42522-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with
 ligatures
Date: Thu, 13 Aug 2020 09:54:50 -0700
Evan Moses <emoses <at> gmail.com> writes:

> Seems to work fine now; Thanks!

Thanks.  I'm therefore closing this bug report.

Best regards,
Stefan Kangas




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

This bug report was last modified 4 years and 279 days ago.

Previous Next


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