GNU bug report logs - #5281
23.1; xml-parse-region causes infinite loops if the region is not well-formed XML

Previous Next

Package: emacs;

Reported by: Yuto Hayamizu <y.hayamizu <at> gmail.com>

Date: Tue, 6 Oct 2009 18:55:07 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 5281 in the body.
You can then email your comments to 5281 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-submit-list <at> lists.donarmstrong.com, svenjoac <at> gmx.de, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#5284; Package emacs. (Wed, 09 Dec 2009 09:45:06 GMT) Full text and rfc822 format available.

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

From: Yuto Hayamizu <y.hayamizu <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: y.hayamizu <at> gmail.com
Subject: bug#5281: 23.1; xml-parse-region causes infinite loops if the region is not well-formed XML
Date: Tue, 29 Dec 2009 14:41:40 +0900 (JST)
Following code causes infinite loop:

    (with-temp-buffer
      (insert "foo</bar>")
      (xml-parse-region (point-min) (point-max)))

Docstring of xml-parse-region says "Returns the XML list for the
region, or raises an error if the region is not well-formed XML.", so
I think the expected result of this code is nil.

In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1)
 of 2009-10-01 on salmon
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--program-suffix=23' '--prefix=/usr/local' 'CFLAGS=-g -O3''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: @im=uim
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  global-widen-window-mode: t
  widen-window-mode: t
  global-typing-outputz-mode: t
  typing-outputz-mode: t
  iswitchb-mode: t
  auto-insert-mode: t
  global-auto-complete-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p <help-echo> 
C-l <help-echo> C-n <help-echo> C-n <help-echo> C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n <help-echo> C-n <help-echo> C-n C-n C-n C-n <help-echo> 
C-n <help-echo> C-e <help-echo> C-j <help-echo> SPC 
<help-echo> l <help-echo> C-j <help-echo> l <help-echo> 
( ) <help-echo> C-b <help-echo> U <help-echo> b u <help-echo> 
n <help-echo> t <help-echo> u <help-echo> SPC <help-echo> 
9 <help-echo> . <help-echo> 0 <help-echo> 4 <help-echo> 
C-j <help-echo> n o <help-echo> S A <help-echo> i <help-echo> 
s i <help-echo> n <help-echo> n <help-echo> b a <help-echo> 
n <help-echo> n <help-echo> SPC <help-echo> C-j <help-echo> 
C-b <help-echo> C-b <help-echo> C-b <help-echo> C-b 
<help-echo> C-b <help-echo> C-b C-b C-b C-b C-b C-b 
C-b <help-echo> C-b <help-echo> C-b <help-echo> C-b 
<help-echo> C-b <help-echo> C-b <help-echo> C-k <help-echo> 
C-j <help-echo> t o <help-echo> , <help-echo> l <help-echo> 
g <help-echo> i t <help-echo> C-j <help-echo> d <help-echo> 
e <help-echo> t o <help-echo> r <help-echo> e <help-echo> 
r <help-echo> u <help-echo> S a <help-echo> i <help-echo> 
s i <help-echo> n <help-echo> n <help-echo> b a n n 
<help-echo> SPC <help-echo> C-j <help-echo> n o <help-echo> 
R <help-echo> y o <help-echo> u <help-echo> h o <help-echo> 
u SPC <help-echo> C-j <help-echo> . <help-echo> l <help-echo> 
C-n <help-echo> C-l <help-echo> C-n <help-echo> C-n 
<help-echo> C-l <help-echo> C-n <help-echo> C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
<help-echo> C-p <help-echo> C-p <help-echo> C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p <help-echo> M-x e m a c s SPC b 
u <tab> C-a C-k b u g <tab> C-a C-k r e p o <tab> r 
t SPC e m a <tab> b u <tab> <return>

Recent messages:
cond: Beginning of buffer [9 times]
Matches =518d=73fe=3057=305f=74b0=5883=306f GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1) of 2009-10-01 (... [19-]
Matches =518d=73fe=3057=305f=74b0=5883=306f GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1) of 2009-10-01 (Ubuntu 9.04=306e=6700=65b0=7248) [19]
cond: End of buffer [3 times]
Saving file /home/haya/Dropbox/blog/emacs-xml-parse-region.txt...
Wrote /home/haya/Dropbox/blog/emacs-xml-parse-region.txt
Contacting host: outputz.com:80
(Shell command failed with code 1 and no output)
Reading [text/html; charset=UTF-8]... 14 bytes of 2 bytes (700%)
Making completion list...


Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Wed, 30 Jun 2010 20:36:02 GMT) Full text and rfc822 format available.

Notification sent to Yuto Hayamizu <y.hayamizu <at> gmail.com>:
bug acknowledged by developer. (Wed, 30 Jun 2010 20:36:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Yuto Hayamizu <y.hayamizu <at> gmail.com>
Cc: 5281-done <at> debbugs.gnu.org
Subject: Re: bug#5281: 23.1;
	xml-parse-region causes infinite loops if the region is not
	well-formed XML
Date: Wed, 30 Jun 2010 16:35:07 -0400
> Following code causes infinite loop:
>
>     (with-temp-buffer
>       (insert "foo</bar>")
>       (xml-parse-region (point-min) (point-max)))

Thanks, I've checked in a fix.




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

This bug report was last modified 14 years and 329 days ago.

Previous Next


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