develooper Front page | perl.perl5.porters | Postings from July 2005

Re: [perl #36667] Lengthy parameter passed to eval leads to bus error on FreeBSD 5.4

Thread Previous
From:
Dominic Dunlop
Date:
July 28, 2005 13:12
Subject:
Re: [perl #36667] Lengthy parameter passed to eval leads to bus error on FreeBSD 5.4
Message ID:
D3DF0E7D-2D8B-4390-8AB8-0888620F7AA9@mac.com
On 2005–07–28, at 08:51, Dominic Dunlop wrote:
> On 2005–07–27, at 20:31, John Narron wrote:
>
>> perl -e 'my $x = q[if ($h->{ALPHA}->{BETA}->{q{stuff}}) {] .  
>> "\n" . q[
>> stuff($h, @_);] . "\n}\n\n"; $x x= 7238; $x =~ s/stuff/"stuff" .
>> ++$count/eg; eval $x'
>>
>
> Problem confirmed with the above script on Mac OS X. The tipping  
> point for a debugging bleadperl@25218 with a stack limit of 8192k  
> is $x x= 26197. For a 64-bit perl it's somewhat more than half  
> that; for a production perl 5.8.6, it's much higher -- somewhere  
> between 70 and 80,000.

Another data point: the problem's not specific to eval -- with this  
variant of the program, which pipes the generated script to a child  
perl, the child perl blows its stack at almost exactly the same point  
(21969 vs 21968) as in the original.

./perl -e 'my $x = q[if ($h->{ALPHA}->{BETA}->{q{stuff}}) {] . "\n" . q[
stuff($h, @_);] . "\n}\n\n"; $x x= 26199; $x =~ s/stuff/"stuff" .
++$count/eg;$x .= q(print "done\n";); open P, "|./perl -w" or die  
"Pipe open failed: !$\n"; print P $x; close P'

-- 
Dominic Dunlop


Thread Previous


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