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

[perl #38470] Silent self-termination of script using regex.

From:
Steve Peters via RT
Date:
March 29, 2006 10:42
Subject:
[perl #38470] Silent self-termination of script using regex.
Message ID:
rt-3.0.11-38470-131674.16.9101825568411@perl.org
> [nigelsandever@btconnect.com - Wed Feb 08 15:15:30 2006]:
> 
> To: perlbug@perl.org
> Subject: Silent self-termination of script using regex.
> Cc: support@ActiveState.com
> Reply-To: c52qlbm02 @ sneakemail . com
> Message-Id: <5.8.6_548_1139438697@D4KG9X0J>
> 
> This is a bug report for perl from c52qlbm02 @ sneakemail . com,
> generated with the help of perlbug 1.35 running under perl v5.8.6.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> The following script self terminates silently. No segfault or warning
> or Panic.
> On my system it occurs when the repetition count moves above 21165.
> 
> On someone elses Win32 system it aborts at around 31300.
> 
> #! perl -w
> use strict;
> #use re 'debug';
> 
> my $str = 'a' x 100000;
> my $char = 'a';
> 
> for my $n ( map{ $_ * 1000 + 165 } 1 .. 30 ) {
>     pos($str)=0;
>     $str =~ /(?:.*?$char){$n}/g;
>     print "Pos of '$char' #$n in \$str is ", pos($str), "\n";
> }
> 
> __END__
> C:\test>junk
> Pos of 'a' #1165 in $str is 1165
> Pos of 'a' #2165 in $str is 2165
> Pos of 'a' #3165 in $str is 3165
> Pos of 'a' #4165 in $str is 4165
> Pos of 'a' #5165 in $str is 5165
> Pos of 'a' #6165 in $str is 6165
> Pos of 'a' #7165 in $str is 7165
> Pos of 'a' #8165 in $str is 8165
> Pos of 'a' #9165 in $str is 9165
> Pos of 'a' #10165 in $str is 10165
> Pos of 'a' #11165 in $str is 11165
> Pos of 'a' #12165 in $str is 12165
> Pos of 'a' #13165 in $str is 13165
> Pos of 'a' #14165 in $str is 14165
> Pos of 'a' #15165 in $str is 15165
> Pos of 'a' #16165 in $str is 16165
> Pos of 'a' #17165 in $str is 17165
> Pos of 'a' #18165 in $str is 18165
> Pos of 'a' #19165 in $str is 19165
> Pos of 'a' #20165 in $str is 20165
> Pos of 'a' #21165 in $str is 21165
> 

It sounds like you were getting some sort of silent GPF or something
related.  This problem seems to have been resolved with change #27598.

steve@kirk:~/smoke/perl-current$ perl rt_38470.pl
Pos of 'a' #1165 in $str is 1165
Segmentation fault (core dumped)
steve@kirk:~/smoke/perl-current$ ./perl -Ilib rt_38470.pl
Pos of 'a' #1165 in $str is 1165
Pos of 'a' #2165 in $str is 2165
Pos of 'a' #3165 in $str is 3165
Pos of 'a' #4165 in $str is 4165
Pos of 'a' #5165 in $str is 5165
Pos of 'a' #6165 in $str is 6165
Pos of 'a' #7165 in $str is 7165
Pos of 'a' #8165 in $str is 8165
Pos of 'a' #9165 in $str is 9165
Pos of 'a' #10165 in $str is 10165
Pos of 'a' #11165 in $str is 11165
Pos of 'a' #12165 in $str is 12165
Pos of 'a' #13165 in $str is 13165
Pos of 'a' #14165 in $str is 14165
Pos of 'a' #15165 in $str is 15165
Pos of 'a' #16165 in $str is 16165
Pos of 'a' #17165 in $str is 17165
Pos of 'a' #18165 in $str is 18165
Pos of 'a' #19165 in $str is 19165
Pos of 'a' #20165 in $str is 20165
Pos of 'a' #21165 in $str is 21165
Pos of 'a' #22165 in $str is 22165
Pos of 'a' #23165 in $str is 23165
Pos of 'a' #24165 in $str is 24165
Pos of 'a' #25165 in $str is 25165
Pos of 'a' #26165 in $str is 26165
Pos of 'a' #27165 in $str is 27165
Pos of 'a' #28165 in $str is 28165
Pos of 'a' #29165 in $str is 29165
Pos of 'a' #30165 in $str is 30165




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