develooper Front page | perl.perl5.porters | Postings from June 2009

[perl #59654] SIGSEGV compiling regexp in 5.10.0

Hugo van der Sanden via RT
June 26, 2009 07:41
[perl #59654] SIGSEGV compiling regexp in 5.10.0
Message ID:
On Mon Oct 06 09:06:13 2008, salva wrote:
> Compiling/parsing complex regular expressions cause perl to SIGSEGV.
> For instance:
> my $len = 6000;
> my $re = join('|', (("a(?:b") x $len), "a") . (")" x $len);
> $re = qr/$re/; # ==> Segmentation fault

Just took a quick look at this: it segvs in today's blead due to a
recursive call in S_study_chunk(), which is blowing the stack:
  /* we suppose the run is continuous, last=next...*/
  minnext = study_chunk(pRExC_state, &scan, minlenp, &deltanext,
                        next, &data_fake,
                        stopparen, recursed, NULL, f,depth+1);

I have not tried to work out what would be involved in fixing it, and
the class of things made possible by fixing it doesn't seem to include
much that's useful. I may come back to this later.

Hugo Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About