GNU bug report logs - #1116
Emacs hangs when executing Info-final-node

Previous Next

Package: emacs;

Reported by: "Sung-Taek Lim" <totohero <at> gmail.com>

Date: Wed, 8 Oct 2008 00:55:04 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

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 1116 in the body.
You can then email your comments to 1116 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, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Sung-Taek Lim" <totohero <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Sung-Taek Lim" <totohero <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs hangs when executing Info-final-node
Date: Wed, 8 Oct 2008 09:48:27 +0900
I' running GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON

D:\> runemacs -Q --debug-init

C-h i       ;; open *info*
Press '>'  ;; execute 'Info-final-node and emacs hangs!

Always reproduced.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Sung-Taek Lim <totohero <at> gmail.com>
Cc: 1116 <at> debbugs.gnu.org
Subject: Re: bug#1116: Emacs hangs when executing Info-final-node
Date: Wed, 08 Oct 2008 16:58:00 +0200
[Message part 1 (text/plain, inline)]
> I' running GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON
>
> D:\> runemacs -Q --debug-init
>
> C-h i       ;; open *info*
> Press '>'  ;; execute 'Info-final-node and emacs hangs!
>
> Always reproduced.

Would the attached patch help?

martin
[1116.diff (text/plain, inline)]
*** info.el.~1.501.2.7.~	2008-03-25 14:48:24.000000000 +0100
--- info.el	2008-10-08 16:52:49.703125000 +0200
***************
*** 2437,2449 ****
      (Info-goto-node (Info-extract-menu-counting nil))
      ;; If the last node in the menu is not last in pointer structure,
      ;; move forward until we can't go any farther.
!     (while (Info-forward-node t t) nil)
      ;; Then keep moving down to last subnode, unless we reach an index.
      (while (and (not (Info-index-node))
  		(save-excursion (search-forward "\n* Menu:" nil t)))
        (Info-goto-node (Info-extract-menu-counting nil)))))
  
! (defun Info-forward-node (&optional not-down no-error)
    "Go forward one node, considering all nodes as forming one sequence."
    (interactive)
    (goto-char (point-min))
--- 2437,2449 ----
      (Info-goto-node (Info-extract-menu-counting nil))
      ;; If the last node in the menu is not last in pointer structure,
      ;; move forward until we can't go any farther.
!     (while (Info-forward-node t t t) nil)
      ;; Then keep moving down to last subnode, unless we reach an index.
      (while (and (not (Info-index-node))
  		(save-excursion (search-forward "\n* Menu:" nil t)))
        (Info-goto-node (Info-extract-menu-counting nil)))))
  
! (defun Info-forward-node (&optional not-down no-error not-up)
    "Go forward one node, considering all nodes as forming one sequence."
    (interactive)
    (goto-char (point-min))
***************
*** 2461,2467 ****
  	  ((save-excursion (search-backward "next:" nil t))
  	   (Info-next)
  	   t)
! 	  ((and (save-excursion (search-backward "up:" nil t))
  		;; Use string-equal, not equal, to ignore text props.
  		(not (string-equal (downcase (Info-extract-pointer "up"))
  				   "top")))
--- 2461,2468 ----
  	  ((save-excursion (search-backward "next:" nil t))
  	   (Info-next)
  	   t)
! 	  ((and (not not-up)
! 		(save-excursion (search-backward "up:" nil t))
  		;; Use string-equal, not equal, to ignore text props.
  		(not (string-equal (downcase (Info-extract-pointer "up"))
  				   "top")))

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #15 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'martin rudalics'" <rudalics <at> gmx.at>, <1116 <at> debbugs.gnu.org>,
        "'Sung-Taek Lim'" <totohero <at> gmail.com>
Subject: RE: bug#1116: Emacs hangs when executing Info-final-node
Date: Wed, 8 Oct 2008 09:00:15 -0700
>  > C-h i       ;; open *info*
>  > Press '>'  ;; execute 'Info-final-node and emacs hangs!
>  >
>  > Always reproduced.
> 
> Would the attached patch help?

I don't mean to butt in here, but I suspect this is due to bug #1117 (probably =
#876). Are there extra ^M at the line ends of the Index page (which is the last
node)?

I have bug #1117 in my latest CVS version, and debugging Info-final-node shows
exactly that. The code gets here, and it just loops because "Top^M" is not
string-equal to "Top".

Debugger entered--returning value: nil
  string-equal("top
" "top")
* (not (string-equal (downcase ...) "top"))
* (and (save-excursion (search-backward "up:" nil t)) (not (string-equal ...
"top")))
* (cond ((and ... ... ...) (Info-goto-node ...) t) ((save-excursion ...)
(Info-next) t) ((and ... ...) (let ... ... ...)) (no-error nil) (t (error "No
pointer forward from this node")))
* (let ((case-fold-search t)) (cond (... ... t) (... ... t) (... ...) (no-error
nil) (t ...)))
* Info-forward-node(t t)
* (while (Info-forward-node t t) nil)
* (let ((Info-history nil) (case-fold-search t)) (Info-goto-node
(Info-extract-menu-counting nil)) (while (Info-forward-node t t) nil) (while
(and ... ...) (Info-goto-node ...)))
* Info-final-node()
  call-interactively(Info-final-node nil nil)

It was looking at Martin's patch that made me think of this - the code is
similar to my code that made me discover bug #1117 - same comparison of "Top^M"
with "Top", but in my case (isearch) an error was raised instead of an infinite
loop.

HTH.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #20 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'martin rudalics'" <rudalics <at> gmx.at>, <1116 <at> debbugs.gnu.org>,
        "'Sung-Taek Lim'" <totohero <at> gmail.com>
Subject: RE: bug#1116: Emacs hangs when executing Info-final-node
Date: Wed, 8 Oct 2008 09:03:15 -0700
I should add that if this is in fact the cause, it shows how vulnerable our code
is to something like extra ^M's - several places break because of node name
comparisons. Maybe some more general remedy should be taken to protect against
this kind of thing.

Node "Top" tends to be at the end of a line for nodes like the Index. Perhaps
node-name tests should even check for a final ^M, just to play dumb-safe. Dunno.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #25 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 1116 <at> debbugs.gnu.org, "'Sung-Taek Lim'" <totohero <at> gmail.com>
Subject: Re: bug#1116: Emacs hangs when executing Info-final-node
Date: Wed, 08 Oct 2008 20:03:05 +0200
> I don't mean to butt in here, but I suspect this is due to bug #1117 (probably =
> #876). Are there extra ^M at the line ends of the Index page (which is the last
> node)?

Have you looked at the original report?  It says

   I' running GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON

> I have bug #1117 in my latest CVS version, and debugging Info-final-node shows
> exactly that. The code gets here, and it just loops because "Top^M" is not
> string-equal to "Top".
[...]
> It was looking at Martin's patch that made me think of this - the code is
> similar to my code that made me discover bug #1117 - same comparison of "Top^M"
> with "Top", but in my case (isearch) an error was raised instead of an infinite
> loop.

You can't test this with current CVS on Windows - the ^Ms get in your
way thus hiding the original bug.

martin





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #30 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'martin rudalics'" <rudalics <at> gmx.at>
Cc: <1116 <at> debbugs.gnu.org>, "'Sung-Taek Lim'" <totohero <at> gmail.com>
Subject: RE: bug#1116: Emacs hangs when executing Info-final-node
Date: Wed, 8 Oct 2008 11:29:22 -0700
>  > I don't mean to butt in here, but I suspect this is due to 
>  > bug #1117 (probably = #876). Are there extra ^M at the line
>  > ends of the Index page (which is the last node)?
> 
> Have you looked at the original report?  It says
> 
>     I' running GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 
>     2008-09-07 on SOFT-MJASON
> 
> You can't test this with current CVS on Windows - the ^Ms get in your
> way thus hiding the original bug.

OK, sorry for the noise.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1116; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Sung-Taek Lim" <totohero <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #35 received at 1116 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Sung-Taek Lim" <totohero <at> gmail.com>
To: "martin rudalics" <rudalics <at> gmx.at>
Cc: 1116 <at> debbugs.gnu.org
Subject: Re: bug#1116: Emacs hangs when executing Info-final-node
Date: Thu, 9 Oct 2008 21:37:36 +0900
Thank you. Your patch works!

2008/10/8, martin rudalics <rudalics <at> gmx.at>:
> > I' running GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on
> SOFT-MJASON
> >
> > D:\> runemacs -Q --debug-init
> >
> > C-h i       ;; open *info*
> > Press '>'  ;; execute 'Info-final-node and emacs hangs!
> >
> > Always reproduced.
>
> Would the attached patch help?
>
> martin
>
> *** info.el.~1.501.2.7.~        2008-03-25 14:48:24.000000000 +0100
> --- info.el     2008-10-08 16:52:49.703125000 +0200
> ***************
> *** 2437,2449 ****
>      (Info-goto-node (Info-extract-menu-counting nil))
>      ;; If the last node in the menu is not last in pointer structure,
>      ;; move forward until we can't go any farther.
> !     (while (Info-forward-node t t) nil)
>      ;; Then keep moving down to last subnode, unless we reach an index.
>      (while (and (not (Info-index-node))
>                (save-excursion (search-forward "\n* Menu:" nil t)))
>        (Info-goto-node (Info-extract-menu-counting nil)))))
>
> ! (defun Info-forward-node (&optional not-down no-error)
>    "Go forward one node, considering all nodes as forming one sequence."
>    (interactive)
>    (goto-char (point-min))
> --- 2437,2449 ----
>      (Info-goto-node (Info-extract-menu-counting nil))
>      ;; If the last node in the menu is not last in pointer structure,
>      ;; move forward until we can't go any farther.
> !     (while (Info-forward-node t t t) nil)
>      ;; Then keep moving down to last subnode, unless we reach an index.
>      (while (and (not (Info-index-node))
>                (save-excursion (search-forward "\n* Menu:" nil t)))
>        (Info-goto-node (Info-extract-menu-counting nil)))))
>
> ! (defun Info-forward-node (&optional not-down no-error not-up)
>    "Go forward one node, considering all nodes as forming one sequence."
>    (interactive)
>    (goto-char (point-min))
> ***************
> *** 2461,2467 ****
>          ((save-excursion (search-backward "next:" nil t))
>           (Info-next)
>           t)
> !         ((and (save-excursion (search-backward "up:" nil t))
>                ;; Use string-equal, not equal, to ignore text props.
>                (not (string-equal (downcase (Info-extract-pointer "up"))
>                                   "top")))
> --- 2461,2468 ----
>          ((save-excursion (search-backward "next:" nil t))
>           (Info-next)
>           t)
> !         ((and (not not-up)
> !               (save-excursion (search-backward "up:" nil t))
>                ;; Use string-equal, not equal, to ignore text props.
>                (not (string-equal (downcase (Info-extract-pointer "up"))
>                                   "top")))
>
>
>




Reply sent to martin rudalics <rudalics <at> gmx.at>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "Sung-Taek Lim" <totohero <at> gmail.com>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #40 received at 1116-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: 1116-done <at> debbugs.gnu.org
Cc: Sung-Taek Lim <totohero <at> gmail.com>
Subject: Re: bug#1116: Emacs hangs when executing Info-final-node
Date: Fri, 10 Oct 2008 15:54:42 +0200
Fixed in Emacs 23.0.60 as

	* info.el (Info-extract-menu-counting): New argment no-detail to
	skip detailed node listings.
	(Info-forward-node): New argument not-up to inhibit going up.
	(Info-final-node): Call Info-extract-menu-counting and
	Info-forward-node with the new arguments set to avoid infinite
	looping.  (Bug#1116)

Thanks for the report, martin.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 07 Nov 2008 15:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 287 days ago.

Previous Next


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