Skip Menu |
Report information
Id: 105918
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: sprout <sprout [at] cpan.org>
Cc:
AdminCc:

Operating System: darwin
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.15.5
Fixed In: (no value)

Attachments
0001-Fix-perl-105918-Tied-hashes-stringify-their-hash-key.patch



Subject: Tied hashes stringify their hash keys as of 5.8.3
Date: Sun, 11 Dec 2011 13:14:48 -0800
To: perlbug [...] perl.org
From: Father Chrysostomos <sprout [...] cpan.org>
Download (untitled) / with headers
text/plain 3.3k
As of this commit: commit 113738bb099c38d994cf82554560490df0f6d525 Author: Nicholas Clark <nick@ccl4.org> Date: Wed Nov 19 22:28:25 2003 +0000 merge hv_fetch and hv_fetch_ent into hv_fetch_common remove S_hv_fetch_flags hv.c now 13% smaller than when I started. hv_store TODO p4raw-id: //depot/perl@21753 tied hashes now stringify their keys: { package o; use overload '""' => sub { warn "stingify"; "a" }; } sub TIEHASH { bless [] } sub STORE { warn join " ", map +(ref||$_), @'_ } tie %h, ""; $h{bless [], o} = 34; __END__ That should not print ‘stingify’. The value passed to STORE is not stringified, but the keys get stringified unnecessarily on the way. This caused a script to blow up in my face, because the object in question couldn’t stringify without creating another object that was stored in the same cache. --- Flags: category=core severity=low --- Site configuration information for perl 5.15.5: Configured by sprout at Sat Nov 26 11:40:22 PST 2011. Summary of my perl5 (revision 5 version 15 subversion 5) configuration: Snapshot of: c071f8d7e26d951a082adc9cd79aae32680c01ae Platform: osname=darwin, osvers=10.5.0, archname=darwin-thread-multi-2level uname='darwin pint.local 10.5.0 darwin kernel version 10.5.0: fri nov 5 23:20:39 pdt 2010; root:xnu-1504.9.17~1release_i386 i386 ' config_args='-de -Dusedevel -Duseithreads -Dmad' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define 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 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O3', cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 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 =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, 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 -fstack-protector' Locally applied patches: --- @INC for perl 5.15.5: /usr/local/lib/perl5/site_perl/5.15.5/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.15.5 /usr/local/lib/perl5/5.15.5/darwin-thread-multi-2level /usr/local/lib/perl5/5.15.5 /usr/local/lib/perl5/site_perl . --- Environment for perl 5.15.5: DYLD_LIBRARY_PATH (unset) HOME=/Users/sprout LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin PERL_BADLANG (unset) SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On Sun, 11 Dec 2011 21:15:10 GMT, sprout wrote: Show quoted text
> As of this commit: > > commit 113738bb099c38d994cf82554560490df0f6d525 > Author: Nicholas Clark <nick@ccl4.org> > Date: Wed Nov 19 22:28:25 2003 +0000 > > merge hv_fetch and hv_fetch_ent into hv_fetch_common > remove S_hv_fetch_flags > hv.c now 13% smaller than when I started. hv_store TODO > > p4raw-id: //depot/perl@21753 > > tied hashes now stringify their keys: > > { > package o; > use overload '""' => sub { warn "stingify"; "a" }; > } > > sub TIEHASH { bless [] } > sub STORE { warn join " ", map +(ref||$_), @'_ } > > tie %h, ""; > > $h{bless [], o} = 34; > __END__ > > That should not print ‘stingify’. > > The value passed to STORE is not stringified, but the keys get > stringified unnecessarily on the way. > > This caused a script to blow up in my face, because the object in > question couldn’t stringify without creating another object that was > stored in the same cache. >
This ticket was filed nearly 6 years ago. It concerns a commit made nearly 14 years ago. But in the time the ticket has been open there have been no other comments. Can we infer that this is not a problem that needs fixing? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 183b
On Fri, 29 Sep 2017 19:39:30 -0700, jkeenan wrote: Show quoted text
> Can we infer that this is not a problem that needs fixing?
It is still a bug, and it is still fixable. -- Father Chrysostomos
Date: Sat, 30 Sep 2017 15:38:37 +0200
Subject: Re: [perl #105918] Tied hashes stringify their hash keys as of 5.8.3
From: Bo Lindbergh <blgl [...] stacken.kth.se>
To: perlbug-followup [...] perl.org
Download (untitled) / with headers
text/plain 197b
Fixes the reported problem; causes no new test failures. Do other cases exist where hash keys should not be stringified? If you can think of any, this is the time to mention them! /Bo Lindbergh

Message body is not shown because sender requested not to inline it.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org