develooper Front page | perl.perl5.porters | Postings from March 2006

[perl #38717] Perl Segfault in Regex Match

From:
Steve Peters via RT
Date:
March 29, 2006 09:03
Subject:
[perl #38717] Perl Segfault in Regex Match
Message ID:
rt-3.0.11-38717-131646.10.1836628221847@perl.org
> [shlomif@iglu.org.il - Sun Mar 12 05:22:22 2006]:
> 
> 
> This is a bug report for perl from shlomif@iglu.org.il,
> generated with the help of perlbug 1.35 running under perl v5.8.7.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> The following program segfaults after printing "A" and before printing
>    "B":
> 
> <<<<<<<<
> 
> use strict;
> use warnings;
> my $string = qq{'} . "hello" x 10_000;
> print "A\n";
> $string =~ s{a|'(?:\\.|[^'\\])*'}{};
> print "B\n";
> 
> >>>>>>>>
> 
> This code was adapted from a more complex example that was discovered
>    by
> Yossi Itzkovich:
> 
> http://perl.org.il/pipermail/perl/2006-March/007695.html
> 
> So it will be a good idea to see that the segfault there does not
>    happen
> either.
> 

With change #27598, the core dump has gone away, but a panic is still
generated.

steve@kirk:~/smoke/perl-current$ ./perl -Ilib rt_38717.pl
A
Complex regular subexpression recursion limit (32766) exceeded at
rt_38717.pl line 7.
B
steve@kirk:~/smoke/perl-current$ cat  rt_38717.pl
#!perl

use strict;
use warnings;
my $string = qq{'} . "hello" x 10_000;
print "A\n";
$string =~ s{a|'(?:\\.|[^'\\])*'}{};
print "B\n";




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About