Bug#422788: Strings larger than 4 GB result in strange behavior

Dominic Hargreaves dom at earth.li
Sat Apr 6 21:22:22 UTC 2013


On Tue, May 08, 2007 at 10:06:10AM +0200, Florian Weimer wrote:
> Package: perl
> Version: 5.8.8-7
> 
> The script below, when invoked with "perl script.pl 8" prints
> "256/256", followed by "XXXXX".  When invoked as "perl script.pl 32",
> I get "4294967296/4294967296", followed by ... an empty line.
> Apparently, substr fails for such strings.  There are more obscure
> failures related to substr, but I haven't got a test case for them.
> 
> This occurs on an amd64 machine with sufficient address space.
> 
> It's probably best to die with an error message when the creation of a
> string of unsupported size is attempted.

On an i386 system with 2GB of RAM this test program returns:

Out of memory during string extend at ./422788.pl line 6.

On an amd64 system with 8GB of RAM it returns:

panic: memory wrap at ./422788.pl line 6.

Both which wheezy.

So I think this bug is now resolved?

Cheers,
Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




More information about the Perl-maintainers mailing list