[Israel.pm] segmentation fault in regex

Shlomi Fish shlomif at iglu.org.il
Sun Mar 12 06:22:23 PST 2006


On Sunday 12 March 2006 15:23, Mikhael Goikhman wrote:
> On 12 Mar 2006 15:04:14 +0200, Shlomi Fish wrote:
> > OK, I was able to minimise the segfaulting program to:
> >
> > <<<<<<<<<<<<<<<<
> > use strict;
> > use warnings;
> > my $string = qq{'} . "hello" x 10_000;
> > print "A\n";
> > $string =~ s{a|'(?:\\.|[^'\\])*'}{};
> > print "B\n";
>
> As I said, you only get your process killed if you have small stacksize
> limit (say 10Mb). If you increase it to 14Mb, you get perl error:
>
>   Complex regular subexpression recursion limit (32766) exceeded at - line
> 6.
>

I see. Is there anything the perl core hackers can do to prevent perl from 
crashing if it ran out of stack?

Regards,

	Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://www.shlomifish.org/

95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.



More information about the Perl mailing list