# New Ticket Created by Fergal Daly
# Please include the string: [perl #34230]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34230 >
This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.34 running under perl v5.8.0.
-----------------------------------------------------------------
[Please enter your report here]
#! perl -slw
use strict;
use Data::Dumper;
$Data::Dumper::Deepcopy = 0;
my %h;
$h{ $_ } = [ 1 .. 10 ] for 'aaaa' .. 'zzzz';
print Dumper \%h;
eats gigs of memory, I have no idea how long it takes to finish, if it all.
It's because DD catalogs every scalar even when deepcopy is off. Attached is
a patch against 2.121 to stop cataloging when Deepcopy is off. I don't think
there's another reason to catalog scalars but I could be wrong.
Fergal
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=medium
---
Site configuration information for perl v5.8.0:
Configured by jwright at Mon Oct 4 18:36:47 PDT 2004.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.22-gg9, archname=i386-linux-thread-multi
uname='linux underlord.corp.google.com 2.4.22-gg9 #9 fri mar 19 14:06:44
pst 2004 i686 i686 i386 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686
-Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc.
-Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr
-Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm
-Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl
-Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef 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='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -march=i386 -mcpu=i686',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING
-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.2.2 20030222 (Red Hat Linux 3.2.2-5)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
MAINT18379
---
@INC for perl v5.8.0:
/home/fergal/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/home/fergal/local/lib/perl5/site_perl/5.8.0
/home/fergal/local/lib/perl5/site_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.
---
Environment for perl v5.8.0:
HOME=/home/fergal
LANG=en_US
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/local/scripts:/sbin:/usr/sbin:/usr/local/sbin:/home/fergal/local/bin:/home/fergal/my/bin:/home/build/public/google/tools:/home/build/public/eng/perforce:/home/fergal/local/bin:/home/fergal/my/bin:/home/build/public/google/tools:/home/build/public/eng/perforce:/usr/kerberos/bin:/usr/local/scripts:/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/fergal/bin
PERL5LIB=/home/fergal/local/lib/perl5/site_perl
PERL_BADLANG (unset)
SHELL=/bin/bash
--- ./Data/Dumper.pm.orig 2005-02-22 20:17:13.000000000 -0800
+++ ./Data/Dumper.pm 2005-02-22 20:16:47.000000000 -0800
@@ -405,7 +405,7 @@
my $ref = \$_[1];
# first, catalog the scalar
- if ($name ne '') {
+ if ($s->{deepcopy} and ($name ne '')) {
($id) = ("$ref" =~ /\(([^\(]*)\)$/);
if (exists $s->{seen}{$id}) {
if ($s->{seen}{$id}[2]) {