Subject: | Version.pm gives different results for comparisons under 5.8.9(broken) and 5.10.0 |
Hi John,
I found a rather alarming bug in version.pm. It seems comparisons
against big numbers (picked an arbitrary one, did not check for the
lower bound) produce broken results on 64bit on 5.8.9 (and presumably
all of 5.8.x):
### first with perl5.8.9
$ ~/perl/5.8.9/bin/perl -Mversion -le'print version->VERSION'
0.76
$ ~/perl/5.8.9/bin/perl -Mversion -le'print version->new(qq[3.26]) <=
version->new( ~0/1000 )'
### now with perl5.10.0
$ ~/perl/5.10.0/bin/perl -Mversion -le'print version->VERSION'
0.76
$ ~/perl/5.10.0/bin/perl -Mversion -le'print version->new(qq[3.26]) <=
version->new( ~0/1000 )'
1
Here's the full perl -V for both perls used:
$ ~/perl/5.8.9/bin/perl -VSummary of my perl5 (revision 5 version 8
subversion 9) configuration:
Platform:
osname=solaris, osvers=2.11, archname=i86pc-solaris-64int
uname='sunos open-solaris-noc 5.11 snv_95 i86pc i386 i86pc '
config_args='-Dcc=gcc -Dprefix=~/perl/5.8.9 -Duse64bitint -d'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DPTR_IS_LONG -fno-strict-aliasing -pipe
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV',
optimize='-O',
cppflags='-DPTR_IS_LONG -fno-strict-aliasing -pipe'
ccversion='', gccversion='3.4.3 (csl-sol210-3_4-20050802)',
gccosandvers='solaris2.11'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' '
libpth=/usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Compile-time options: PERL_MALLOC_WRAP PERL_USE_SAFE_PUTENV USE_64_BIT_INT
USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO
Built under solaris
Compiled at Apr 23 2009 11:22:11
%ENV:
PERL5LIB="/export/home/jos/sources/perl/CPANPLUS-0.85_08/inc/bundle"
PERL5OPT=""
@INC:
/export/home/jos/sources/perl/CPANPLUS-0.85_08/inc/bundle
/export/home/jos/perl/5.8.9/lib/5.8.9/i86pc-solaris-64int
/export/home/jos/perl/5.8.9/lib/5.8.9
/export/home/jos/perl/5.8.9/lib/site_perl/5.8.9/i86pc-solaris-64int
/export/home/jos/perl/5.8.9/lib/site_perl/5.8.9
.
$ ~/perl/5.10.0/bin/perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.11, archname=i86pc-solaris-64int
uname='sunos open-solaris-noc 5.11 snv_95 i86pc i386 i86pc '
config_args='-Dcc=gcc -Dprefix=~/perl/5.8.10 -Duse64bitint -d'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DPTR_IS_LONG -fno-strict-aliasing -pipe
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV',
optimize='-O',
cppflags='-DPTR_IS_LONG -fno-strict-aliasing -pipe'
ccversion='', gccversion='3.4.3 (csl-sol210-3_4-20050802)',
gccosandvers='solaris2.11'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' '
libpth=/usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_LARGE_FILES
USE_PERLIO
Built under solaris
Compiled at Apr 23 2009 11:48:22
%ENV:
PERL5LIB="/export/home/jos/sources/perl/CPANPLUS-0.85_08/inc/bundle"
PERL5OPT=""
@INC:
/export/home/jos/sources/perl/CPANPLUS-0.85_08/inc/bundle
/export/home/jos/perl/5.8.10/lib/5.10.0/i86pc-solaris-64int
/export/home/jos/perl/5.8.10/lib/5.10.0
/export/home/jos/perl/5.8.10/lib/site_perl/5.10.0/i86pc-solaris-64int
/export/home/jos/perl/5.8.10/lib/site_perl/5.10.0
.