perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

repetition operator does not throw error when right operand is too large

Open p5pRT opened this issue 12 years ago • 4 comments

Migrated from rt.perl.org#120075 (status was 'open')

Searchable as RT120075$

p5pRT avatar Oct 02 '13 12:10 p5pRT

From [email protected]

$perl -e 'print length("x" x (2**30)), "\n"' 1073741824

$perl -e 'print length("x" x (2**60)), "\n"' Out of memory! panic​: fold_constants JMPENV_PUSH returned 2 at -e line 1.

$perl -e 'print length("x" x (2**99)), "\n"' 0

$ perl -V Summary of my perl5 (revision 5 version 19 subversion 4) configuration​:

  Platform​:   osname=linux, osvers=2.6.38-16-generic, archname=x86_64-linux   uname='linux green-u 2.6.38-16-generic #67~lucid1-ubuntu smp fri sep 7 18​:18​:45 utc 2012 x86_64 gnulinux '   config_args='-de -Dprefix=/home/vse/perl5/perlbrew/perls/perl-5.19.4 -Dusedevel -Aeval​:scriptdir=/home/vse/perl5/perlbrew/perls/perl-5.19.4/bin'   hint=recommended, useposix=true, d_sigaction=define   useithreads=undef, usemultiplicity=undef   useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef   use64bitint=define, use64bitall=define, uselongdouble=undef   usemymalloc=n, bincompat5005=undef   Compiler​:   cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',   optimize='-O2',   cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'   ccversion='', gccversion='4.4.3', gccosandvers=''   intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16   ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8   alignbytes=8, prototype=define   Linker and Libraries​:   ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'   libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib/x86_64-linux-gnu /lib64 /usr/lib64   libs=-lnsl -ldl -lm -lcrypt -lutil -lc   perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc   libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a   gnulibc_version='2.11.1'   Dynamic Linking​:   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'   cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:   Compile-time options​: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV   PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP   PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV   PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT   USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE   USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO   USE_PERL_ATOF   Built under linux   Compiled at Sep 21 2013 20​:11​:23   %ENV​:   PERLBREW_MANPATH="/home/vse/perl5/perlbrew/perls/perl-5.19.4/man"

PERLBREW_PATH="/home/vse/perl5/perlbrew/bin​:/home/vse/perl5/perlbrew/perls/perl-5.19.4/bin"   PERLBREW_PERL="perl-5.19.4"   PERLBREW_ROOT="/home/vse/perl5/perlbrew"   PERLBREW_SKIP_INIT="1"   PERLBREW_VERSION="0.65"   @​INC​:

/home/vse/perl5/perlbrew/perls/perl-5.19.4/lib/site_perl/5.19.4/x86_64-linux   /home/vse/perl5/perlbrew/perls/perl-5.19.4/lib/site_perl/5.19.4   /home/vse/perl5/perlbrew/perls/perl-5.19.4/lib/5.19.4/x86_64-linux   /home/vse/perl5/perlbrew/perls/perl-5.19.4/lib/5.19.4   .

p5pRT avatar Oct 02 '13 12:10 p5pRT

From @jkeenan

On Wed Oct 02 05​:40​:38 2013, vsespb wrote​:

$perl -e 'print length("x" x (2**30)), "\n"' 1073741824

$perl -e 'print length("x" x (2**60)), "\n"' Out of memory! panic​: fold_constants JMPENV_PUSH returned 2 at -e line 1.

$perl -e 'print length("x" x (2**99)), "\n"' 0

On the dromedary server, which is also x86_64-linux, the threshold for flipping to '0' as the output seems to be somewhere between 2**62 and 2**63 (fwiw).

p5pRT avatar Oct 03 '13 01:10 p5pRT

The RT System itself - Status changed from 'new' to 'open'

p5pRT avatar Oct 03 '13 01:10 p5pRT

From [email protected]

Maybe related to the fact that "Infinity" treated as -1 sometimes

perl -e 'my @​a = (71, 72); print $a["info\n"], "\n"' 72

explained here http​://www.perlmonks.org/?node_id=657366 (which looks like another bug)

On Wed Oct 02 18​:16​:22 2013, jkeenan wrote​:

On Wed Oct 02 05​:40​:38 2013, vsespb wrote​:

$perl -e 'print length("x" x (2**30)), "\n"' 1073741824

$perl -e 'print length("x" x (2**60)), "\n"' Out of memory! panic​: fold_constants JMPENV_PUSH returned 2 at -e line 1.

$perl -e 'print length("x" x (2**99)), "\n"' 0

On the dromedary server, which is also x86_64-linux, the threshold for flipping to '0' as the output seems to be somewhere between 2**62 and 2**63 (fwiw).

p5pRT avatar Oct 03 '13 15:10 p5pRT