all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on
@ 2014-01-15  3:16 Levin Du
  2014-01-15 13:48 ` Agustin Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Levin Du @ 2014-01-15  3:16 UTC (permalink / raw)
  To: 16449

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)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on
  2014-01-15  3:16 bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on Levin Du
@ 2014-01-15 13:48 ` Agustin Martin
  2014-01-15 14:58 ` Dmitry Antipov
  2014-01-16  1:45 ` Levin Du
  2 siblings, 0 replies; 5+ messages in thread
From: Agustin Martin @ 2014-01-15 13:48 UTC (permalink / raw)
  To: Levin Du, 16449

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on
  2014-01-15  3:16 bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on Levin Du
  2014-01-15 13:48 ` Agustin Martin
@ 2014-01-15 14:58 ` Dmitry Antipov
  2014-01-16  1:45 ` Levin Du
  2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Antipov @ 2014-01-15 14:58 UTC (permalink / raw)
  To: 16449; +Cc: Levin Du

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






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on
  2014-01-15  3:16 bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on Levin Du
  2014-01-15 13:48 ` Agustin Martin
  2014-01-15 14:58 ` Dmitry Antipov
@ 2014-01-16  1:45 ` Levin Du
  2014-01-17  9:29   ` Levin Du
  2 siblings, 1 reply; 5+ messages in thread
From: Levin Du @ 2014-01-16  1:45 UTC (permalink / raw)
  To: 16449

[-- Attachment #1: Type: text/plain, Size: 3999 bytes --]

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@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)
>

[-- Attachment #2: Type: text/html, Size: 5375 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on
  2014-01-16  1:45 ` Levin Du
@ 2014-01-17  9:29   ` Levin Du
  0 siblings, 0 replies; 5+ messages in thread
From: Levin Du @ 2014-01-17  9:29 UTC (permalink / raw)
  To: 16449

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 939 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-17  9:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15  3:16 bug#16449: 24.3.50; emacs hangs while deleting comment in xml file with flyspell-mode on Levin Du
2014-01-15 13:48 ` Agustin Martin
2014-01-15 14:58 ` Dmitry Antipov
2014-01-16  1:45 ` Levin Du
2014-01-17  9:29   ` Levin Du

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.