help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Stack overflow in regexp matcher


From: Dan Davison
Subject: Re: Stack overflow in regexp matcher
Date: Sun, 06 Feb 2011 14:30:26 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (darwin)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Sun, 06 Feb 2011 14:31:43 +0100
>> 
>> On Sun, 06 Feb 2011 10:47:42 +0000 Dan Davison <dandavison7@gmail.com> 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

It fails on these (I didn't find any machines/builds where it worked):

* OS X
** 23
*** local build
   GNU Emacs 23.2.1 (x86_64-apple-darwin10.6.0, NS
   apple-appkit-1038.35) of 2011-01-20 on <my OS X 10.6.6 machine>
*** aquamacs
   GNU Emacs 23.2.91.1 (x86_64-apple-darwin10.6.0, NS
   apple-appkit-1038.35) of 2011-02-01 on
   94.196.104.92.threembb.co.uk - Aquamacs Distribution 2.2dev
*** emacsformacosx
   GNU Emacs 23.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.29) of
   2010-05-09 on black.local
** 24
*** local build
    GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.6.0, NS
    apple-appkit-1038.35) of 2011-01-13 on <my OS X 10.6.6 machine>
* Ubuntu
** 23
   GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.0) of
   2010-03-29 on yellow, modified by Debian


> I guess it depends on how large is the available stack space.




reply via email to

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