From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ami Fischman" Newsgroups: gmane.emacs.devel Subject: performance/hang bug in regex.c Date: Mon, 1 Sep 2008 22:53:38 -0700 Message-ID: <9aa0cfde0809012253j18394460s9954a0651eefbd5b@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220334835 20172 80.91.229.12 (2 Sep 2008 05:53:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Sep 2008 05:53:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 02 07:54:49 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KaOql-0003Q0-Os for ged-emacs-devel@m.gmane.org; Tue, 02 Sep 2008 07:54:48 +0200 Original-Received: from localhost ([127.0.0.1]:36505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaOpm-0004tg-SP for ged-emacs-devel@m.gmane.org; Tue, 02 Sep 2008 01:53:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaOph-0004tY-Ma for emacs-devel@gnu.org; Tue, 02 Sep 2008 01:53:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaOpg-0004tM-Qz for emacs-devel@gnu.org; Tue, 02 Sep 2008 01:53:41 -0400 Original-Received: from [199.232.76.173] (port=60260 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaOpg-0004tJ-N6 for emacs-devel@gnu.org; Tue, 02 Sep 2008 01:53:40 -0400 Original-Received: from ey-out-1920.google.com ([74.125.78.149]:25779) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KaOpg-0000zx-AV for emacs-devel@gnu.org; Tue, 02 Sep 2008 01:53:40 -0400 Original-Received: by ey-out-1920.google.com with SMTP id 4so852254eyg.24 for ; Mon, 01 Sep 2008 22:53:38 -0700 (PDT) Original-Received: by 10.210.118.7 with SMTP id q7mr7738867ebc.47.1220334818398; Mon, 01 Sep 2008 22:53:38 -0700 (PDT) Original-Received: by 10.210.56.12 with HTTP; Mon, 1 Sep 2008 22:53:38 -0700 (PDT) Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103415 Archived-At: 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.