emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performance/hang bug in regex.c


From: Ami Fischman
Subject: performance/hang bug in regex.c
Date: Mon, 1 Sep 2008 22:53:38 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]