develooper Front page | perl.perl5.porters | Postings from September 2006

[perl #40388] perl_destruct() leaks PL_main_cv

Thread Next
From:
gozer @ activestate . com
Date:
September 22, 2006 01:47
Subject:
[perl #40388] perl_destruct() leaks PL_main_cv
Message ID:
rt-3.5.HEAD-31251-1158871581-121.40388-75-0@perl.org
# New Ticket Created by  gozer@activestate.com 
# Please include the string:  [perl #40388]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40388 >



This is a bug report for perl from gozer@activestate.com,
generated with the help of perlbug 1.35 running under perl 5.9.4.


-----------------------------------------------------------------
[Please enter your report here]

In perl_destruct():

756:    PL_main_start = NULL;
757:    SvREFCNT_dec(PL_main_cv); /* At this point, SvREFCNT(PL_main_cv) is the number of main::* subs */
758:    PL_main_cv = NULL;
759:    PL_dirty = TRUE;

I am not sure what it's caused by, but it's directly related to the number of subs in main::
 
$> perl -e'sub foo {}'
perl_destruct leaking a PL_main_cv with refcnt=2
$> perl -e'sub foo { }; sub bar {}'
perl_destruct leaking a PL_main_cv with refcnt=3
$> perl -e'sub foo { }; sub bar {}; sub baz {};'
perl_destruct leaking a PL_main_cv with refcnt=4

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.9.4:

Configured by gozer at Thu Sep 21 13:27:41 PDT 2006.

Summary of my perl5 (revision 5 version 9 subversion 4 patch 28880) configuration:
  Platform:
    osname=linux, osvers=2.6.17-1.2174_fc5smp, archname=i686-linux-thread-multi
    uname='linux coupler.activestate.com 2.6.17-1.2174_fc5smp #1 smp tue aug 8 16:00:39 edt 2006 i686 i686 i386 gnulinux '
    config_args='-des -Dusedevel -Duseshrplib -Dusethreads -Duseithreads -Doptimize=-g -Dprefix=/home/gozer/opt/perl/i386-linux/current/debug/28880'
    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 ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='4.1.1 20060525 (Red Hat 4.1.1-1)', 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='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.4.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/gozer/opt/perl/i386-linux/current/debug/28880/lib/5.9.4/i686-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.9.4:
    /home/gozer/opt/lib/perl5
    /home/gozer/opt/lib/perl5/site_perl
    /home/gozer/opt/perl_lib/lib
    /home/gozer/opt/perl/i386-linux/current/debug/28880/lib/5.9.4/i686-linux-thread-multi
    /home/gozer/opt/perl/i386-linux/current/debug/28880/lib/5.9.4
    /home/gozer/opt/perl/i386-linux/current/debug/28880/lib/site_perl/5.9.4/i686-linux-thread-multi
    /home/gozer/opt/perl/i386-linux/current/debug/28880/lib/site_perl/5.9.4
    .

---
Environment for perl 5.9.4:
    HOME=/home/gozer
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/gozer/opt/lib
    LOGDIR (unset)
    PATH=/home/gozer/bin:/home/gozer/opt/bin:/home/gozer/bin:/home/gozer/opt/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/lib/jre/bin:/home/gozer/bin:/home/gozer/opt/activestate.com/komodo/current/bin:/usr/lib/jre/bin:/home/gozer/bin:/home/gozer/opt/activestate.com/komodo/current/bin
    PERL5LIB=/home/gozer/opt/lib/perl5:/home/gozer/opt/lib/perl5/site_perl:/home/gozer/opt/perl_lib/lib
    PERL5_CPANPLUS_CONFIG=/home/gozer/.cpanplus/config
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About