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

[perl #21333] Regexp segfault --> ("X"x3529) =~ /( (?: \\. | [^\$] ){1,4000} )/gx;

From:
Steve Peters via RT
Date:
March 29, 2006 08:59
Subject:
[perl #21333] Regexp segfault --> ("X"x3529) =~ /( (?: \\. | [^\$] ){1,4000} )/gx;
Message ID:
rt-3.0.11-21333-131644.12.0516078182315@perl.org
> [jonas@paranormal.se - Fri Feb 21 13:34:14 2003]:
> 
> 
> This is a bug report for perl from jonas@paranormal.se,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> This row causes a segfault:
> 
>   ("X"x3529) =~ /( (?: \\. | [^\$] ){1,4000} )/gx;
> 
> 
> I came upon this using the Template Toolkit
> 
>     Template::Parser,v 2.66 (from TT 2.08) segfaults
> 
> The regexp is found on row 402 in that module.
> 
> 
> Remove the 'x' and the program works.
> 
> Let the string be shorter than 3529 bytes, and the program works.
> 
> 
> I'm using Perl 5.8.0-15, Debian package.
> 

This appears to have been fixed with change #27598.

steve@kirk:~/smoke/perl-current$ perl -wle'("X"x3529) =~ /( (?: \\. |
[^\$] ){1,4000} )/gx;'
Segmentation fault
steve@kirk:~/smoke/perl-current$ ./perl -wle'("X"x3529) =~ /( (?: \\. |
[^\$] ){1,4000} )/gx;'
steve@kirk:~/smoke/perl-current$



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