Subject: | Incorrect hash copy in 5.9.5 |
Using blead perl patch level 31281, a clone is made of a hashref, and an
incorrect copy results.
Original:
$VAR1 = {
'generation' => 0,
'infos' => {},
'schema' => undef,
'seg_counter' => 0,
'version' => '1189391688318'
};
Duplicate:
$VAR1 = {
'generation' => 0,
'infos' => {},
'schema' => undef,
'seg_counter' => $VAR1->{'infos'},
'version' => '1189391688318'
};
I tried to duplicate this bug in a minimal test case, but unfortunately
could not. I can duplicate it consistently, though -- the KinoSearch
0.20_04 test suite fails catastrophically because of it. This appears
to hold true not only for my reasonably recent bleadperl, but also for
the official release of 5.9.5, judging by this CPAN testers report:
<http://www.nntp.perl.org/group/perl.cpan.testers/2007/08/msg582537.html>.
The problem seems to be that sv_clone() is incorrectly retrieving an
earlier stored value. sv_clone() was hard enough to grok that I gave up
trying to debug it.
For now I've switched to Storable::dclone and after one other adustment
to deal with a qr// entity that Clone handles correctly but Storable
does not, the KinoSearch test suite passes once more with blead perl.
slothbear:~ marvin$ /usr/local/bleadperl/bin/perl5.9.5 -V
Summary of my perl5 (revision 5 version 9 subversion 5 patch 31281)
configuration:
Platform:
osname=darwin, osvers=8.9.0, archname=darwin-2level
uname='darwin slothbear.local 8.9.0 darwin kernel version 8.9.0: thu
feb 22 20:54:07 pst 2007; root:xnu-792.17.14~1release_ppc power
macintosh powerpc '
config_args='-Dusedevel -Dprefix=/usr/local/bleadperl -des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5367)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-ldbm -ldl -lm -lc
perllibs=-ldl -lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO
Locally applied patches:
DEVEL
Built under darwin
Compiled at May 26 2007 08:25:26
%ENV:
PERL5LIB="/Users/marvin/projects/atperllib"
@INC:
/Users/marvin/projects/atperllib
/usr/local/bleadperl/lib/5.9.5/darwin-2level
/usr/local/bleadperl/lib/5.9.5
/usr/local/bleadperl/lib/site_perl/5.9.5/darwin-2level
/usr/local/bleadperl/lib/site_perl/5.9.5
.
slothbear:~ marvin$