unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1116: Emacs hangs when executing Info-final-node
@ 2008-10-08  0:48 ` Sung-Taek Lim
  2008-10-08 14:58   ` martin rudalics
  2008-10-10 14:05   ` bug#1116: marked as done (Emacs hangs when executing Info-final-node) Emacs bug Tracking System
  0 siblings, 2 replies; 8+ messages in thread
From: Sung-Taek Lim @ 2008-10-08  0:48 UTC (permalink / raw)
  To: bug-gnu-emacs

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.







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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08  0:48 ` bug#1116: Emacs hangs when executing Info-final-node Sung-Taek Lim
@ 2008-10-08 14:58   ` martin rudalics
  2008-10-08 16:00     ` Drew Adams
                       ` (2 more replies)
  2008-10-10 14:05   ` bug#1116: marked as done (Emacs hangs when executing Info-final-node) Emacs bug Tracking System
  1 sibling, 3 replies; 8+ messages in thread
From: martin rudalics @ 2008-10-08 14:58 UTC (permalink / raw)
  To: Sung-Taek Lim; +Cc: 1116

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

 > 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

[-- Attachment #2: 1116.diff --]
[-- Type: text/plain, Size: 2073 bytes --]

*** 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")))

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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08 14:58   ` martin rudalics
@ 2008-10-08 16:00     ` Drew Adams
  2008-10-08 18:03       ` martin rudalics
  2008-10-08 16:03     ` Drew Adams
  2008-10-09 12:37     ` Sung-Taek Lim
  2 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2008-10-08 16:00 UTC (permalink / raw)
  To: 'martin rudalics', 1116, 'Sung-Taek Lim'

>  > 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.







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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08 14:58   ` martin rudalics
  2008-10-08 16:00     ` Drew Adams
@ 2008-10-08 16:03     ` Drew Adams
  2008-10-09 12:37     ` Sung-Taek Lim
  2 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2008-10-08 16:03 UTC (permalink / raw)
  To: 'martin rudalics', 1116, 'Sung-Taek Lim'

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.







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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08 16:00     ` Drew Adams
@ 2008-10-08 18:03       ` martin rudalics
  2008-10-08 18:29         ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2008-10-08 18:03 UTC (permalink / raw)
  To: Drew Adams; +Cc: 'Sung-Taek Lim', 1116

 > 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







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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08 18:03       ` martin rudalics
@ 2008-10-08 18:29         ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2008-10-08 18:29 UTC (permalink / raw)
  To: 'martin rudalics'; +Cc: 'Sung-Taek Lim', 1116

>  > 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.







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

* bug#1116: Emacs hangs when executing Info-final-node
  2008-10-08 14:58   ` martin rudalics
  2008-10-08 16:00     ` Drew Adams
  2008-10-08 16:03     ` Drew Adams
@ 2008-10-09 12:37     ` Sung-Taek Lim
  2 siblings, 0 replies; 8+ messages in thread
From: Sung-Taek Lim @ 2008-10-09 12:37 UTC (permalink / raw)
  To: martin rudalics; +Cc: 1116

Thank you. Your patch works!

2008/10/8, martin rudalics <rudalics@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")))
>
>
>






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

* bug#1116: marked as done (Emacs hangs when executing Info-final-node)
  2008-10-08  0:48 ` bug#1116: Emacs hangs when executing Info-final-node Sung-Taek Lim
  2008-10-08 14:58   ` martin rudalics
@ 2008-10-10 14:05   ` Emacs bug Tracking System
  1 sibling, 0 replies; 8+ messages in thread
From: Emacs bug Tracking System @ 2008-10-10 14:05 UTC (permalink / raw)
  To: martin rudalics

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


Your message dated Fri, 10 Oct 2008 15:54:42 +0200
with message-id <48EF5EA2.8050408@gmx.at>
and subject line Re: bug#1116: Emacs hangs when executing Info-final-node
has caused the Emacs bug report #1116,
regarding Emacs hangs when executing Info-final-node
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
1116: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1116
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3170 bytes --]

From: "Sung-Taek Lim" <totohero@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: Emacs hangs when executing Info-final-node
Date: Wed, 8 Oct 2008 09:48:27 +0900
Message-ID: <c944a1210810071748q7e156308r2902ae106f885cfb@mail.gmail.com>

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.




[-- Attachment #3: Type: message/rfc822, Size: 1921 bytes --]

From: martin rudalics <rudalics@gmx.at>
To: 1116-done@emacsbugs.donarmstrong.com
Cc: Sung-Taek Lim <totohero@gmail.com>
Subject: Re: bug#1116: Emacs hangs when executing Info-final-node
Date: Fri, 10 Oct 2008 15:54:42 +0200
Message-ID: <48EF5EA2.8050408@gmx.at>

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.


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

end of thread, other threads:[~2008-10-10 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <48EF5EA2.8050408@gmx.at>
2008-10-08  0:48 ` bug#1116: Emacs hangs when executing Info-final-node Sung-Taek Lim
2008-10-08 14:58   ` martin rudalics
2008-10-08 16:00     ` Drew Adams
2008-10-08 18:03       ` martin rudalics
2008-10-08 18:29         ` Drew Adams
2008-10-08 16:03     ` Drew Adams
2008-10-09 12:37     ` Sung-Taek Lim
2008-10-10 14:05   ` bug#1116: marked as done (Emacs hangs when executing Info-final-node) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).