GNU bug report logs - #16449
24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on

Previous Next

Package: emacs;

Reported by: Levin Du <zslevin <at> gmail.com>

Date: Wed, 15 Jan 2014 03:21:02 UTC

Severity: normal

Tags: confirmed, fixed

Merged with 20995, 22319, 24253, 28040

Found in versions 24.3.50, 24.5, 25.1.50, 25.2

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

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 16449 in the body.
You can then email your comments to 16449 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#16449; Package emacs. (Wed, 15 Jan 2014 03:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Levin Du <zslevin <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 15 Jan 2014 03:21:03 GMT) Full text and rfc822 format available.

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

From: Levin Du <zslevin <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 emacs hangs while deleting comment in xml file with flyspell-mode on
Date: Wed, 15 Jan 2014 11:16:17 +0800
1. Starting from `emacs -Q'

2. open a xml file with contents shown below:

<?xml version="1.0" encoding="UTF-8"?>
<window>
  <control>
    <!--<visible>Player.HasAudio + !Skin.HasSetting(homepageMusicinfo)</visible>-->
    <visible>false</visible>
  </control>
</window>

3. Turn on flyspell mode with `M-x flyspell-mode'

4. Move the cursor to the comment start '<!--', then begin to delete
 comment start chars with C-d. When the line changes to :
    <visible>Player.HasAudio + !Skin.HasSetting(homepageMusicinfo)</visible>-->

   Emacs hangs.
   
In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.17)
 of 2014-01-15 on DuJingwu
Windowing system distributor `The X.Org Foundation', version 11.0.11303000
System Description:	Ubuntu 13.04

Configured using:
 `configure --with-x-toolkit=gtk2 'CFLAGS=-O0 -g3''

Important settings:
  value of $LC_CTYPE: zh_CN.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x g n u - <backspace> - <tab> <tab> b u <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
C-g C-g C-g <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<menu-bar> <help-menu> <send-emacs-bug-report>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Quit [3 times]
call-interactively: End of buffer

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils help-mode easymenu time-date china-util
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer 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 make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16449; Package emacs. (Wed, 15 Jan 2014 13:49:01 GMT) Full text and rfc822 format available.

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

From: Agustin Martin <agustin.martin <at> hispalinux.es>
To: Levin Du <zslevin <at> gmail.com>, 16449 <at> debbugs.gnu.org
Subject: Re: bug#16449: 24.3.50; emacs hangs while deleting comment in xml
 file with flyspell-mode on
Date: Wed, 15 Jan 2014 14:48:09 +0100
On Wed, Jan 15, 2014 at 11:16:17AM +0800, Levin Du wrote:
> 1. Starting from `emacs -Q'
> 
> 2. open a xml file with contents shown below:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <window>
>   <control>
>     <!--<visible>Player.HasAudio + !Skin.HasSetting(homepageMusicinfo)</visible>-->
>     <visible>false</visible>
>   </control>
> </window>
> 
> 3. Turn on flyspell mode with `M-x flyspell-mode'
> 
> 4. Move the cursor to the comment start '<!--', then begin to delete
>  comment start chars with C-d. When the line changes to :
>     <visible>Player.HasAudio + !Skin.HasSetting(homepageMusicinfo)</visible>-->
> 
>    Emacs hangs.
>
> In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.17)
>  of 2014-01-15 on DuJingwu

Hi,

Cannot reproduce here with emacs-snapshot 20140101 in Debian,
[GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6)].
Here aspell is used spellchecker [/usr/bin/aspell::default] and LANG was set
to "es_ES.UTF-8". Same with

$ LC_ALL=C LANG=C emacs-snapshot -Q  test-16449.xml
$ LC_ALL=C LANG=en_US.UTF-8 emacs-snapshot -Q  test-16449.xml

aspell-es and aspell-en are installed. Which spellchecker and dictionary are
the default at your site? Is something relevant in your messages buffer?

Regards,

-- 
Agustin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16449; Package emacs. (Wed, 15 Jan 2014 14:59:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Antipov <dmantipov <at> yandex.ru>
To: 16449 <at> debbugs.gnu.org
Cc: Levin Du <zslevin <at> gmail.com>
Subject: Re: bug#16449: 24.3.50; emacs hangs while deleting comment in xml
 file with flyspell-mode on
Date: Wed, 15 Jan 2014 18:58:47 +0400
On 01/15/2014 07:16 AM, Levin Du wrote:

> 1. Starting from `emacs -Q'
[...skip...]

Reproduced. Consider simpler example with the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<tag0>
  <!--<tag1>Text</tag1>-->
</tag0>

Visit this file in nxml-mode and try to eval:

(goto-char (nxml-token-after))

from the beginning - you should advance token by token after
each evaluation, up to the end of buffer.

Next, remove comment, i.e. change the XML above to:

<?xml version="1.0" encoding="UTF-8"?>
<tag0>
  <tag1>Text</tag1>
</tag0>

Then try to advance from the beginning again. In my test, nxml-token-after
stops at '<' of '<tag1>' and never continues. Due to this, there is an
endless loop in  nxml-forward-single-balanced-item (lisp/nxml/nxml-mode.el):

 1627  (defun nxml-forward-single-balanced-item ()
 1628    (condition-case err
 1629        (goto-char (let ((end (nxml-token-after)))
 1630                     (save-excursion
 1631                       (while (eq xmltok-type 'space)   ; this is an
 1632                         (goto-char end)                ; endless
 1633                         (setq end (nxml-token-after))) ; loop

BTW, I have no ideas why C-g doesn't help.

Dmitry





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16449; Package emacs. (Thu, 16 Jan 2014 01:46:02 GMT) Full text and rfc822 format available.

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

From: Levin Du <zslevin <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 24.3.50; emacs hangs while deleting comment in xml file with
 flyspell-mode on
Date: Thu, 16 Jan 2014 09:45:06 +0800
[Message part 1 (text/plain, inline)]
Here is the xbacktrace after the hang:
(gdb) xbacktrace
"xmltok-forward" (0xffff93d0)
"nxml-token-after" (0xffff9908)
0x1255860 PVEC_COMPILED
"funcall" (0xffff9e20)
"nxml-forward-single-balanced-item" (0xffffa568)
"nxml-forward-balanced-item" (0xffffaa88)
"forward-sexp" (0xffffaf10)
"byte-code" (0xffffb6b0)
"sgml-parse-tag-backward" (0xffffbbf0)
"sgml-lexical-context" (0xffffc3d0)
"sgml-mode-flyspell-verify" (0xffffc8f0)
"flyspell-word" (0xffffce30)
"byte-code" (0xffffd330)
"flyspell-post-command-hook" (0xffffd980)


Turn off flyspell-mode and everything is fine.

2014/1/15 Levin Du <zslevin <at> gmail.com>

> 1. Starting from `emacs -Q'
>
> 2. open a xml file with contents shown below:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <window>
>   <control>
>     <!--<visible>Player.HasAudio +
> !Skin.HasSetting(homepageMusicinfo)</visible>-->
>     <visible>false</visible>
>   </control>
> </window>
>
> 3. Turn on flyspell mode with `M-x flyspell-mode'
>
> 4. Move the cursor to the comment start '<!--', then begin to delete
>  comment start chars with C-d. When the line changes to :
>     <visible>Player.HasAudio +
> !Skin.HasSetting(homepageMusicinfo)</visible>-->
>
>    Emacs hangs.
>
> In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.17)
>  of 2014-01-15 on DuJingwu
> Windowing system distributor `The X.Org Foundation', version 11.0.11303000
> System Description:     Ubuntu 13.04
>
> Configured using:
>  `configure --with-x-toolkit=gtk2 'CFLAGS=-O0 -g3''
>
> Important settings:
>   value of $LC_CTYPE: zh_CN.UTF-8
>   value of $LANG: en_US.UTF-8
>   value of $XMODIFIERS: @im=ibus
>   locale-coding-system: utf-8-unix
>
> Major mode: Lisp Interaction
>
> Minor modes in effect:
>   tooltip-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>   line-number-mode: t
>   transient-mark-mode: t
>
> Recent input:
> M-x g n u - <backspace> - <tab> <tab> b u <tab> <backspace>
> <backspace> <backspace> <backspace> <backspace> <backspace>
> <backspace> <backspace> <backspace> <backspace> <backspace>
> C-g C-g C-g <help-echo> <help-echo> <help-echo> <help-echo>
> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
> <menu-bar> <help-menu> <send-emacs-bug-report>
>
> Recent messages:
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Making completion list...
> Quit [3 times]
> call-interactively: End of buffer
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
> mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
> gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
> help-fns mail-prsvr mail-utils help-mode easymenu time-date china-util
> tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
> x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
> newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
> select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
> frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
> tai-viet lao korean japanese hebrew greek romanian slovak czech european
> ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
> simple abbrev minibuffer 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 make-network-process
> dbusbind gfilenotify dynamic-setting system-font-setting
> font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16449; Package emacs. (Fri, 17 Jan 2014 09:30:02 GMT) Full text and rfc822 format available.

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

From: Levin Du <zslevin <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 24.3.50; emacs hangs while deleting comment in xml file with
 flyspell-mode on
Date: Fri, 17 Jan 2014 17:29:39 +0800
[Message part 1 (text/plain, inline)]
I trace down to the while loop in nxml-forward-single-balanced-item:

(defun nxml-forward-single-balanced-item ()
  (condition-case err
      (goto-char (let ((end (nxml-token-after)))
   (save-excursion
     (while (eq xmltok-type 'space)
       (goto-char end)
       (setq end (nxml-token-after)))
     (cond ((/= (point) xmltok-start)

In my test xml file, when the last comment char is deleted, `end' will be
65, then (nxml-token-after) also returns 65  , so this is a endless loop.
[Message part 2 (text/html, inline)]

Merged 16449 20995. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 06 Jul 2015 21:06:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 06 Jul 2015 21:06:02 GMT) Full text and rfc822 format available.

Merged 16449 20995 22319. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Jan 2016 18:01:01 GMT) Full text and rfc822 format available.

Merged 16449 20995 22319. Request was from Nicolas Petton <nicolas <at> petton.fr> to control <at> debbugs.gnu.org. (Wed, 06 Jan 2016 18:35:02 GMT) Full text and rfc822 format available.

Merged 16449 20995 22319 24253 28040. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 11 Aug 2017 01:06:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 12 Aug 2017 01:11:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 28040 <at> debbugs.gnu.org and Avinash Chopde <avinash <at> aczoom.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 12 Aug 2017 01:11:03 GMT) Full text and rfc822 format available.

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

This bug report was last modified 6 years and 230 days ago.

Previous Next


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