Subject: Re: bug#20995: 24.5; uncomment XML file results in high CPU utilisation / hanging

From: Sam Halliday <[email-masked]>
Date: Mon, 06 Jul 2015 21:49:26 +0100

Hi Glenn,

Sorry, I was being sloppy.

I tried to minimise the problem and enabling flyspell in the XML file
seems to be the culprit. So:

emacs -Q
M-x file-find "...xml file I gave you..."
M-x flyspell-mode
... go to final comment line...
M-; (i.e. M-x uncomment-region)

I did a (profiler-start) with (setq debug-on-quit t) and got this:

- flyspell-post-command-hook                                     1994  81%
 - byte-code                                                     1994  81%
  - flyspell-word                                                1992  81%
   - sgml-mode-flyspell-verify                                   1989  81%
    - sgml-lexical-context                                       1985  81%
     - sgml-parse-tag-backward                                   1985  81%
      - byte-code                                                1985  81%
       - forward-sexp                                            1985  81%
        - nxml-forward-balanced-item                             1985  81%
         - nxml-forward-single-balanced-item                     1985  81%
          - funcall                                              1985  81%
           + #<compiled 0xf573b1>                                1949  80%

Glenn Morris <[email-masked]> writes:

> Sam Halliday wrote:
>
>> I just upgraded from 24.4 to 24.5 on Debian Jessie (self compiled) and
>> if I open an XML file containing the below information, and attempt to
>> M-: uncomment the last comment line in the file, Emacs eats 100%
>> CPU and I have to kill it. I can confirm that it works OK in 24.4:
>
> What does "M-: uncomment" mean? 
> Please give a complete recipe starting from emacs -Q.
>
> FWIW, works fine for me in 24.5 to mark the last comment line and use
> M-x uncomment-region.

-- 
Best regards,
Sam