From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Stack overflow in regexp matcher Date: Sun, 06 Feb 2011 09:17:50 -0500 Message-ID: References: <87wrldcmrk.fsf@escher.home> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1297001901 31151 80.91.229.12 (6 Feb 2011 14:18:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Feb 2011 14:18:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 06 15:18:17 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pm5RP-0006VA-2c for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Feb 2011 15:18:15 +0100 Original-Received: from localhost ([127.0.0.1]:50107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pm5RO-0008VH-Ik for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Feb 2011 09:18:14 -0500 Original-Received: from [140.186.70.92] (port=40439 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pm5R1-0008Sl-B8 for help-gnu-emacs@gnu.org; Sun, 06 Feb 2011 09:17:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pm5R0-0007mr-Ay for help-gnu-emacs@gnu.org; Sun, 06 Feb 2011 09:17:51 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:60856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pm5R0-0007ml-9I for help-gnu-emacs@gnu.org; Sun, 06 Feb 2011 09:17:50 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Pm5R0-0007ee-7c for help-gnu-emacs@gnu.org; Sun, 06 Feb 2011 09:17:50 -0500 In-reply-to: <87wrldcmrk.fsf@escher.home> (message from Stephen Berman on Sun, 06 Feb 2011 14:31:43 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78988 Archived-At: > From: Stephen Berman > Date: Sun, 06 Feb 2011 14:31:43 +0100 > > On Sun, 06 Feb 2011 10:47:42 +0000 Dan Davison wrote: > > > The following fails with "Stack overflow in regexp matcher" in emacs 23 > > and 24: > > > > (string-match > > "^\\[.+\\]$" > > (concat > > "[" > > (mapconcat (lambda (i) "x") (number-sequence 1 33500) "") > > "]")) > > > > This surprised me; I assumed that the ^ and $ anchors, and the simple > > ".+" requirement in the middle would result in a simple, efficient > > regexp. > > It does not fail on my GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ > Version 2.20.1) of 2011-01-13, but returns, as expected, 0. Nor does it fail here: GNU Emacs 23.2.91.1 (i386-mingw-nt5.1.2600) of 2010-12-11 on 3249CTO but does enter the debugger here: GNU Emacs 23.2.93.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-02-03 on fencepost I guess it depends on how large is the available stack space.