all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ami Fischman" <ami@fischman.org>
To: emacs-devel@gnu.org
Subject: performance/hang bug in regex.c
Date: Mon, 1 Sep 2008 22:53:38 -0700	[thread overview]
Message-ID: <9aa0cfde0809012253j18394460s9954a0651eefbd5b@mail.gmail.com> (raw)

In a buffer containing the single line:
aaba-----------------------------------------
with point at the beginning of the line, executing this:
M-:(re-search-forward "\\([^ab]+\\)+bb") RET
sends emacs into a tizzy: 100% CPU is consumed and emacs appears hung;
C-g unhangs it.  Shortening the line (reducing the number of dashes)
changes behavior to a delay followed by the no-match error being
triggered (correctly).  This repros reliably with 22.1.1 and with CVS
HEAD as of 2008/08/10.  I do not have a fix or a workaround other than
avoiding \\(...+\\)+ patterns.

Cheers,
-a

P.S. This recipe is a much-simplified version of a regexp that occurs
in erin-mode (http://www.neilvandyke.org/erin-twiki-emacs/).  Its
occurrence there is in a font-lock pattern and causes emacs to hang
after the bug is triggered; not even C-g can make emacs stop trying to
match the pattern.  A workaround is to remove the lone "+" at
erin.el:382.




             reply	other threads:[~2008-09-02  5:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02  5:53 Ami Fischman [this message]
2008-09-02 20:26 ` performance/hang bug in regex.c Stefan Monnier
2008-09-03  2:41   ` Richard M. Stallman
2008-09-03  3:48     ` Thomas Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aa0cfde0809012253j18394460s9954a0651eefbd5b@mail.gmail.com \
    --to=ami@fischman.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.