GNU bug report logs - #7593
24.0.50; No response from 'occur' (infinite loop when regexp matches empty string?)

Previous Next

Package: emacs;

Reported by: Larry Denenberg <larry <at> denenberg.com>

Date: Wed, 8 Dec 2010 18:58:01 UTC

Severity: minor

Found in version 24.0.50

Done: Chong Yidong <cyd <at> gnu.org>

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 7593 in the body.
You can then email your comments to 7593 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7593; Package emacs. (Wed, 08 Dec 2010 18:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Larry Denenberg <larry <at> denenberg.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 Dec 2010 18:58:02 GMT) Full text and rfc822 format available.

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

From: Larry Denenberg <larry <at> denenberg.com>
To: bug-gnu-emacs <at> gnu.org
Cc: larry <at> denenberg.com
Subject: 24.0.50;
	No response from 'occur' (infinite loop when regexp matches empty
	string?)
Date: Wed, 08 Dec 2010 13:53:36 -0500
This bug manifests in all versions of GNU emacs that I have.  The facts:

1) Start with 'emacs -nw -Q'.  We see buffer *scratch* containing the
initial greeting ';; This buffer is for notes . . .'.

2) Enter 'M-x occur<RET>'.  We're now in the minibuffer with prompt
'List lines matching regexp:'.

3) Enter 'a*<RET>'.  Emacs stops responding.

I believe the problem is in function occur-engine (file replace.el),
specifically the section labelled 'Highlight the matches'.

		    ;; Highlight the matches
		    (let ((len (length curstring))
			  (start 0))
		      (while (and (< start len)
				  (string-match regexp curstring start))
			(add-text-properties
			 (match-beginning 0) (match-end 0)
			 (append
			  `(occur-match t)
			  (when match-face
			    ;; Use `face' rather than `font-lock-face' here
			    ;; so as to override faces copied from the buffer.
			    `(face ,match-face)))
			 curstring)
			(setq start (match-end 0))))

When the given regexp matches a null string, the final line of code here
does not change variable start, so we loop infinitely.

/Larry Denenberg
larry <at> denenberg.com
http://larry.denenberg.com/

In GNU Emacs 24.0.50.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
 of 2010-08-10 on braeburn.aquamacs.org - Aquamacs Distribution 2.1dev
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns' '--without-x' 'CFLAGS=-arch i386 -arch ppc' 'LDFLAGS=-arch i386 -arch ppc''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  display-time-mode: t
  savehist-mode: t
  smart-frame-positioning-mode: t
  aquamacs-autoface-mode: t
  recentf-mode: t
  osx-key-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  pc-selection-mode: t
  cua-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-xface hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-xface
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-utils hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-utils
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-tool-bar hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-tool-bar
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-thread hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-thread
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-speed hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-speed
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-show hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-show
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-seq hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-seq
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-search hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-search
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-scan hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-scan
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-print hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-print
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-mime hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-mime
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-loaddefs hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-loaddefs
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-limit hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-limit
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-letter hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-letter
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-junk hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-junk
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-inc hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-inc
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-identity hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-identity
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-gnus hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-gnus
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-funcs hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-funcs
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-folder hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-folder
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-e hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-e
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-compat hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-compat
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-comp hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-comp
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-buffers hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-buffers
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-alias hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-alias
/Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-acros hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-acros
/Users/larry/Emacs/Bin/hebrew hides /Applications/Aquamacs.app/Contents/Resources/lisp/language/hebrew

Features:
(shadow emacsbug thai-util thai-word lao-util flyspell ispell cua-rect
rect utf-7 compile comint ring find-func sort mule-util info mh-limit
browse-url flow-fill cperl-mode dabbrev mh-thread multi-isearch mh-funcs
mh-search mh-alias multi-prompt crm qp mail-extr mh-identity mh-letter
mh-comp smiley mh-mime mh-gnus mh-show goto-addr gnus-cite gnus-art
mm-uu mml2015 pgg pgg-parse pgg-def epg-config mm-view smime
password-cache dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source
format-spec gnus-start gnus-spec gnus-int message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode gmm-utils mailheader gnus-win gnus-range
gnus gnus-ems nnheader mh-inc hl-line mh-tool-bar mh-seq mh-xface
mh-utils mh-folder which-func imenu mh-scan mh-e mh-compat mailabbrev
mh-acros mh-buffers mh-loaddefs time-stamp newcomment texmathp preview
prv-emacs reftex-vcr reftex-dcr reftex-auc reftex reftex-vars bib-cite
tex-fold tex-bar tex-buf toolbar-x noutline outline font-latex latex
tex-style tex latexenc ebuff-menu electric url-http tls url-auth
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-util url-parse auth-source gnus-util url-vars mm-util mail-prsvr
mailcap mail-utils time-date package quail help-mode jka-compr time
edmacro kmacro load-emacs-plugins aquamacs-mode-defaults auctex-config
server preview-latex tex-site auto-loads smart-dnd aquamacs-aux savehist
mouse-sel one-buffer-one-frame smart-frame-positioning drews_init
color-theme-autoloads view saveplace visual-line aquamacs-bug
aquamacs-autoface-mode aquamacs-editing sendmail recentf tree-widget
cus-edit osxkeys emulate-mac-keyboard-mode frame-cmds strings misc-fns
thingatpt+ thingatpt frame-fns avoid aquamacs-mac-fontsets fit-frame
aquamacs-frame-setup aquamacs-tabbar tabbar-window cl cl-19 tabbar
warnings cus-start cus-load load-emacs-pre-plugins aquamacs-site-start
filladapt aquamacs-redo check-for-updates aquamacs-menu osx_defaults
aquamacs-tool-bar aquamacs mac-extra-functions aquamacs-tools
aquamacs-macros parse-time timezone paren delsel pc-select cua-base
wid-edit regexp-opt advice advice-preload byte-opt bytecomp byte-compile
debug help-fns image-file disp-table easy-mmode tooltip ediff-hook
vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag 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 loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process ns
multi-tty emacs)




Reply sent to Chong Yidong <cyd <at> gnu.org>:
You have taken responsibility. (Wed, 18 Dec 2013 05:12:02 GMT) Full text and rfc822 format available.

Notification sent to Larry Denenberg <larry <at> denenberg.com>:
bug acknowledged by developer. (Wed, 18 Dec 2013 05:12:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> gnu.org>
To: Larry Denenberg <larry <at> denenberg.com>
Cc: 7593-done <at> debbugs.gnu.org
Subject: Re: bug#7593: 24.0.50;
 No response from 'occur' (infinite loop when regexp matches empty
 string?)
Date: Wed, 18 Dec 2013 13:11:32 +0800
> 1) Start with 'emacs -nw -Q'.  We see buffer *scratch* containing the
> initial greeting ';; This buffer is for notes . . .'.
>
> 2) Enter 'M-x occur<RET>'.  We're now in the minibuffer with prompt
> 'List lines matching regexp:'.
>
> 3) Enter 'a*<RET>'.  Emacs stops responding.

Fixed, thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Jan 2014 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 124 days ago.

Previous Next


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