develooper Front page | perl.perl5.porters | Postings from August 2001

RE: [ID 20010821.004] Pseudo-hash access does not check for non-numeric indices

From:
Wilson, Doug
Date:
August 21, 2001 15:20
Subject:
RE: [ID 20010821.004] Pseudo-hash access does not check for non-numeric indices
Message ID:
35A280DF784CD411A06B0008C7B130ADB5510D@sdex04.sd.intuit.com

> From: Michael G Schwern [mailto:schwern@pobox.com]
> 
> On Tue, Aug 21, 2001 at 01:52:13PM -0700, Sean McAfee wrote:
> > ...but my leaving out of the [0] caused $column to be treated as a
> > pseudo-hash, causing the index of the "files" member to be 
> the expression
> > [ ], which, in numeric context, evaulates to the address of 
> the array being
> > referenced, which is typically a very large number, 
> accounting for the huge
> > memory usage.  Such, at least, is my theory.
> 
> bleadperl says:
> 
>     Out of memory during "large" request for 2147487744 
> bytes, total sbrk() is 77952 bytes at - line 2.

This is like bug 20000519.006, which
used to core dump. And the bug didn't really have
anything to do with pseudo hashes, just array allocations or memory
requests of certain sizes.

This still core dumps for me under 5.6.1 and 5.7.2:
my $var1 = [];
$#$var1 = 2_147_483_647;
my $size = @$var1;
print $size,"\n";



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