From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922 Description of problem: find a memory leak running certain perl scripts. These scripts will leak even when the server isn't under load. These scripts have run successfully without memory leaks in other environments (e.g. RH9, FreeBSD). Also noticed that the problem was lessened when upgraded Perl to 5.8.3-16, but upgrading to 5.8.3-18 didn't help any further. Version-Release number of selected component (if applicable): perl-5.8.0-88.4.i386.rpm How reproducible: Always Steps to Reproduce: 1.Using perl from Red Hat Enterprise Linux 3, it consumes more and more memory when this is being run continuously. 2. the perl-5.8.3-16 used now that has lessen the problem is from the fedora core updates Additional info:
I need some kind of minimal testing script that will reproduce the problem to be able to do anything with this bug, or a reference to an upstream perl bug.
here is a sample code that will produce this leak: #!/usr/bin/perl use strict; use DBI; use Net::SMTP; my $debug = 0; while (1) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; $mon++; my $logfilename = "whois." . sprintf("%04d%02d%02d", $year, $mon, $mday) . ".log"; my $mdp = 'xxx'; my $usager = 'xxx'; my $DBI = "dbi:Oracle:$nom_bd"; my $dbo = DBI -> connect ($DBI,$usager,$mdp, { RaiseError => 1, AutoCommit => 1 } ); unless ($dbo) { sleep(10); next; } my $sto = $dbo->prepare( " select load_seq,operation,rgpc_no from load_discrep order by LOAD_SEQ " ); $sto->execute(); my %done; my %pulld; my %allhash; my $in; my $inn; while (my ($load_seq, $ope, $dom_no) = $sto->fetchrow_array ) { $done{$load_seq} = $dom_no; my $compo = $dom_no . ":" . $ope; $allhash{$compo} = $load_seq; $pulld{$dom_no} = $ope; $in .= $load_seq . ":" . $dom_no . "-" . $ope . "\n"; undef $load_seq; undef $dom_no; undef $ope; undef $compo; } my %reve; foreach (keys %allhash) { $reve{$allhash{$_}} = $_; } my @doms = keys %pulld; my @tot = keys %done; $sto->finish; $dbo->disconnect; $dbo=0; # Close handler for oracle undef $dbo; sleep(1); undef %done; undef %pulld; undef %pulld; undef %allhash; undef $in; undef $inn; undef %reve; undef @doms; undef @tot; next; } ------ this is the environment: [root@tbr01 sb]# perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.21-1.1931.2.393.entsmp, archname=i386-linux-thread-multi uname='linux por' config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dmyhostname=localhost -Dperladmin=root@localhost -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= useperlio= d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=un uselongdouble= usemymalloc=, 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='', 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.3 20030502 (Red Hat Linux 3.2.3-19)', gccosandvers='' gccversion='3.2.3 200305' intsize=o, longsize=s, ptrsize=l, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long' k', ivsize=4' ivtype, nvtype='double' o_no', nvsize=, Off_t='', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc' l', ldflags =' -L/usr/local/lib' ldflags_use' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs= libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libper 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' ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s Unicode/Normalize XS/A' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: MAINT18379 Built under linux Compiled at Sep 15 2003 10:03:52 @INC: /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 /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 .
This problem should be fixed with the current perl-5.8.0-89.10 release in RHEL-3-U6, as it backported code from perl-5.8.3+. Closing as CURRENTRELEASE. If this bug is still a problem for you on RHEL-3-U6, please re-open this bug.