GNU bug report logs - #18577
Regexp I-search: [(error Stack overflow in regexp matcher)]

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alan Mackenzie <acm@HIDDEN>; Keywords: notabug; dated Sun, 28 Sep 2014 09:25:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 18577 <at> debbugs.gnu.org:


Received: (at 18577) by debbugs.gnu.org; 28 Sep 2014 17:35:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 13:35:35 2014
Received: from localhost ([127.0.0.1]:54521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYINi-00010M-KV
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 13:35:34 -0400
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41203)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1XYINf-00010B-En
 for 18577 <at> debbugs.gnu.org; Sun, 28 Sep 2014 13:35:32 -0400
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s8SHZSZa025181;
 Sun, 28 Sep 2014 13:35:28 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id 7457AAE80E; Sun, 28 Sep 2014 13:35:30 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Andreas Schwab <schwab@HIDDEN>
Subject: Re: bug#18577: Regexp I-search: [(error Stack overflow in regexp
 matcher)]
Message-ID: <jwv38bbsme9.fsf-monnier+emacsbugs@HIDDEN>
References: <20140928085554.GA3157@HIDDEN> <87mw9kt3m7.fsf@HIDDEN>
 <20140928123717.GC3157@HIDDEN> <87d2afud0p.fsf@HIDDEN>
Date: Sun, 28 Sep 2014 13:35:30 -0400
In-Reply-To: <87d2afud0p.fsf@HIDDEN> (Andreas Schwab's message of "Sun, 28
 Sep 2014 14:48:22 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5078=0
X-NAI-Spam-Version: 2.3.0.9378 : core <5078> : inlines <1340> : streams
 <1302333> : uri <1819223>
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 18577
Cc: Alan Mackenzie <acm@HIDDEN>, 18577 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

>> Is this a defect in my regexp or in the regexp engine?
> It is fundamental to the way regexp matching works.

To clarify: it is fundamental to the way *our* regexp engine works.

As long as the regexp doesn't use backrefs, it can be matched
efficiently, without backtracking.  Of course using \(..\) (as opposed
to using \(?:..\)) can also make the problem harder since the various
different (but largely equivalent) ways to match might need to be
distinguishable via match-data.

But even tho your regexp doesn't use backrefs, and even if you replace
all \(..\) with \(?:..\), your regexp will still cause problems because
our regexp engine does not try to optimize these kinds of cases.

So you have to do it by hand.

>> If the former, how could I rewrite the regexp so that it would not hit
>> these problems?

Maybe something like:

/\*\(<insidecomment>\)*\*+/

where <insidecomment> is something like

   [^'*]\|\*+\([^/'*]\|'<afterquote>\)\|'<afterquote>

where <afterquote> is something like

   \([^'*]\|\*+[^/'*]\)*'

Tho this will still push a backtrack point for every character.
Maybe better would be something like

/\*[^'*]*\(<insidecomment>\)*\*+/

where <insidecomment> is something like

   \(\*+[^/'*]\|\**'<afterquote>\)[^'*]*

where <afterquote> is still something like

   \([^'*]\|\*+[^/'*]\)*'

so that we should only push a backtrace point when we see a * or a ' in
the comment.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18577; Package emacs. Full text available.

Message received at 18577 <at> debbugs.gnu.org:


Received: (at 18577) by debbugs.gnu.org; 28 Sep 2014 12:48:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 08:48:28 2014
Received: from localhost ([127.0.0.1]:54164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYDts-0002C3-2g
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:48:28 -0400
Received: from mail-out.m-online.net ([212.18.0.10]:54457)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <whitebox@HIDDEN>) id 1XYDtp-0002Bt-Ib
 for 18577 <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:48:26 -0400
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 3j5RVc3PlRz3hjv0;
 Sun, 28 Sep 2014 14:48:24 +0200 (CEST)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.68])
 by mail.m-online.net (Postfix) with ESMTP id 3j5RVc1zT5zvjNV;
 Sun, 28 Sep 2014 14:48:24 +0200 (CEST)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new,
 port 10024)
 with ESMTP id FBYlwJE-OBrR; Sun, 28 Sep 2014 14:48:22 +0200 (CEST)
X-Auth-Info: 9lAfj+HplY0zaz1NkpdxnqalAI+sWRkywpVbXq3UaMsX1ZMEX803oejCMLabguUu
Received: from igel.home (ppp-188-174-146-80.dynamic.mnet-online.de
 [188.174.146.80]) by mail.mnet-online.de (Postfix) with ESMTPA;
 Sun, 28 Sep 2014 14:48:22 +0200 (CEST)
Received: by igel.home (Postfix, from userid 1000)
 id 6793D2C395D; Sun, 28 Sep 2014 14:48:22 +0200 (CEST)
From: Andreas Schwab <schwab@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#18577: Regexp I-search: [(error Stack overflow in regexp
 matcher)]
References: <20140928085554.GA3157@HIDDEN> <87mw9kt3m7.fsf@HIDDEN>
 <20140928123717.GC3157@HIDDEN>
X-Yow: We just joined the civil hair patrol!
Date: Sun, 28 Sep 2014 14:48:22 +0200
In-Reply-To: <20140928123717.GC3157@HIDDEN> (Alan Mackenzie's message of
 "Sun, 28 Sep 2014 12:37:17 +0000")
Message-ID: <87d2afud0p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 18577
Cc: 18577 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Alan Mackenzie <acm@HIDDEN> writes:

> Is this a defect in my regexp or in the regexp engine?

It is fundamental to the way regexp matching works.

> If the former, how could I rewrite the regexp so that it would not hit
> these problems?

Avoid matching the null string in infinite ways.  If you need to match
the null string, make sure it is anchored with non-null matches.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18577; Package emacs. Full text available.

Message received at 18577 <at> debbugs.gnu.org:


Received: (at 18577) by debbugs.gnu.org; 28 Sep 2014 12:42:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 08:42:56 2014
Received: from localhost ([127.0.0.1]:54160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYDoV-00023d-Ps
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:42:56 -0400
Received: from colin.muc.de ([193.149.48.1]:47934 helo=mail.muc.de)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1XYDoS-00023U-Va
 for 18577 <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:42:54 -0400
Received: (qmail 21653 invoked by uid 3782); 28 Sep 2014 12:42:51 -0000
Received: from acm.muc.de (pD951AB19.dip0.t-ipconnect.de [217.81.171.25]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 28 Sep 2014 14:42:50 +0200
Received: (qmail 4488 invoked by uid 1000); 28 Sep 2014 12:37:17 -0000
Date: Sun, 28 Sep 2014 12:37:17 +0000
To: Andreas Schwab <schwab@HIDDEN>
Subject: Re: bug#18577: Regexp I-search: [(error Stack overflow in regexp
 matcher)]
Message-ID: <20140928123717.GC3157@HIDDEN>
References: <20140928085554.GA3157@HIDDEN>
 <87mw9kt3m7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87mw9kt3m7.fsf@HIDDEN>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 18577
Cc: 18577 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

Good afternoon, Andreas!

On Sun, Sep 28, 2014 at 12:56:48PM +0200, Andreas Schwab wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > With point at BOB, do C-M-s and enter this regular expression at the
> > prompt:

> > /\*\(\([^'*]\|\*[^/']\)*\*?'\([^'*]\|\*[^/']\)*\*?'\)*\([^'*]\|\*[^'/]\)*\*?'\([^'*]\|\*[^/']\)*\*?\*/

> \(...\(...\)*...\)* is bad.  \(...\)*\(...\)* is also bad.

But they both seem essential to the regexp's purpose.

> Both can cause combinatorial explosions in backtracking.

Is this a defect in my regexp or in the regexp engine?  If the former,
how could I rewrite the regexp so that it would not hit these problems?

> Andreas.

> -- 
> Andreas Schwab, schwab@HIDDEN
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18577; Package emacs. Full text available.

Message received at 18577 <at> debbugs.gnu.org:


Received: (at 18577) by debbugs.gnu.org; 28 Sep 2014 10:56:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 06:56:56 2014
Received: from localhost ([127.0.0.1]:54136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYC9w-0006jH-Ec
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 06:56:56 -0400
Received: from mail-out.m-online.net ([212.18.0.10]:57477)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <whitebox@HIDDEN>) id 1XYC9u-0006j8-CX
 for 18577 <at> debbugs.gnu.org; Sun, 28 Sep 2014 06:56:55 -0400
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 3j5P1w6r8Dz3hjZY;
 Sun, 28 Sep 2014 12:56:52 +0200 (CEST)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.68])
 by mail.m-online.net (Postfix) with ESMTP id 3j5P1w5RSLzvjNK;
 Sun, 28 Sep 2014 12:56:52 +0200 (CEST)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new,
 port 10024)
 with ESMTP id n3QZ3pJAlBVs; Sun, 28 Sep 2014 12:56:49 +0200 (CEST)
X-Auth-Info: fopicbbCTA8OhYHLugJ0J4z6v29G2lWyOETUdt3l3DJ6cWgFG40iQ3ow+SuAcb62
Received: from igel.home (ppp-188-174-146-80.dynamic.mnet-online.de
 [188.174.146.80]) by mail.mnet-online.de (Postfix) with ESMTPA;
 Sun, 28 Sep 2014 12:56:49 +0200 (CEST)
Received: by igel.home (Postfix, from userid 1000)
 id D0B112C2019; Sun, 28 Sep 2014 12:56:48 +0200 (CEST)
From: Andreas Schwab <schwab@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#18577: Regexp I-search: [(error Stack overflow in regexp
 matcher)]
References: <20140928085554.GA3157@HIDDEN>
X-Yow: I want the presidency so bad I can already taste the hors d'oeuvres.
Date: Sun, 28 Sep 2014 12:56:48 +0200
In-Reply-To: <20140928085554.GA3157@HIDDEN> (Alan Mackenzie's message of
 "Sun, 28 Sep 2014 08:55:55 +0000")
Message-ID: <87mw9kt3m7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 18577
Cc: 18577 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Alan Mackenzie <acm@HIDDEN> writes:

> With point at BOB, do C-M-s and enter this regular expression at the
> prompt:
>
> /\*\(\([^'*]\|\*[^/']\)*\*?'\([^'*]\|\*[^/']\)*\*?'\)*\([^'*]\|\*[^'/]\)*\*?'\([^'*]\|\*[^/']\)*\*?\*/

\(...\(...\)*...\)* is bad.  \(...\)*\(...\)* is also bad.  Both can cause
combinatorial explosions in backtracking.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18577; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Sep 2014 09:24:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 05:24:44 2014
Received: from localhost ([127.0.0.1]:54075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYAih-0004PS-MZ
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 05:24:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33020)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1XYAie-0004PJ-GW
 for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 05:24:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1XYAiO-0001rM-Qd
 for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 05:24:40 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53078)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1XYAiO-0001q2-Oa
 for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 05:24:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33203)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1XYASu-0004PB-Qq
 for bug-gnu-emacs@HIDDEN; Sun, 28 Sep 2014 05:08:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1XYASn-0006uJ-CK
 for bug-gnu-emacs@HIDDEN; Sun, 28 Sep 2014 05:08:24 -0400
Received: from colin.muc.de ([193.149.48.1]:43297 helo=mail.muc.de)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1XYASn-0006tS-2q
 for bug-gnu-emacs@HIDDEN; Sun, 28 Sep 2014 05:08:17 -0400
Received: (qmail 87938 invoked by uid 3782); 28 Sep 2014 09:01:29 -0000
Received: from acm.muc.de (pD951AB19.dip0.t-ipconnect.de [217.81.171.25]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 28 Sep 2014 11:01:28 +0200
Received: (qmail 3291 invoked by uid 1000); 28 Sep 2014 08:55:55 -0000
Date: Sun, 28 Sep 2014 08:55:55 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Regexp I-search: [(error Stack overflow in regexp matcher)]
Message-ID: <20140928085554.GA3157@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.3 (----)

Hi, Emacs.

In the trunk, emacs -Q.  Visit our favourite big file, xdisp.c.

With point at BOB, do C-M-s and enter this regular expression at the
prompt:

/\*\(\([^'*]\|\*[^/']\)*\*?'\([^'*]\|\*[^/']\)*\*?'\)*\([^'*]\|\*[^'/]\)*\*?'\([^'*]\|\*[^/']\)*\*?\*/

Press C-s.  This gives the error message "[(error Stack overflow in
regexp matcher)]".

This feels like a bug.  Regexp searching with this expression (which
finds a block comment containing an odd number of apostrophes) works fine
in the rest of the buffer.  Only in the second (large) comment in xdisp.c
does it trigger this error.  Surely an iterative regexp (which all
regexps are, surely?) shouldn't be triggering unbounded recursive
behaviour in the search engine.

[N.B. the regexp when parsed a bit looks like this:

/\*\(                                              \)*\(     \|       \)*\*?'\(     \|       \)*\*?\*/
     \(     \|       \)*\*?'\(     \|       \)*\*?'     [^'*]  \*[^'/]         [^'*]  \*[^/']
       [^'*]  \*[^/']         [^'*]  \*[^/']

].  

-- 
Alan Mackenzie (Nuremberg, Germany).




Acknowledgement sent to Alan Mackenzie <acm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#18577; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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