develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #114340] Perl 5.16.0 leaks memory

Thread Next
From:
Tokuhiro Matsuno
Date:
August 1, 2012 08:54
Subject:
[perl #114340] Perl 5.16.0 leaks memory
Message ID:
rt-3.6.HEAD-11172-1343725106-843.114340-75-0@perl.org
# New Ticket Created by  "Tokuhiro Matsuno" 
# Please include the string:  [perl #114340]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114340 >


This is a bug report for perl from tokuhirom@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.16.0.


-----------------------------------------------------------------
[Please describe your issue here]

Following code leaks memory.

>||
use strict;

my $kan = bless +{}, 'Kan';
my $code = sub { };

for (1..100) {
    for (1..1000) {
        for my $f ($code, $kan) {
            ref $f;
        }
    }
    my @x = split /\s+/, `ps aux|grep leak.pl|grep -v grep| grep -v vim`;
    print $x[5], $/;
}
||<


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

Configured by tokuhirom at Tue Jul 31 16:58:39 JST 2012.

Summary of my perl5 (revision 5 version 16 subversion 0) configuration:

  Platform:
    osname=darwin, osvers=11.4.0, archname=darwin-2level
    uname='darwin imac 11.4.0 darwin kernel version 11.4.0: mon apr 9
19:32:15 pdt 2012; root:xnu-1699.26.8~1release_x86_64 x86_64 i386
imac11,2 darwin '
    config_args='-de -Dprefix=/Users/tokuhirom/perl5/perlbrew/perls/perl-5.16.0'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, 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 Compatible Apple Clang 3.1
(tags/Apple/clang-318.0.61)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, 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=-lgdbm -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.16.0:
    /Users/tokuhirom/perl5/lib/perl5//darwin-2level
    /Users/tokuhirom/perl5/lib/perl5/
    /Users/tokuhirom/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level
    /Users/tokuhirom/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
    /Users/tokuhirom/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level
    /Users/tokuhirom/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0
    .

---
Environment for perl 5.16.0:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/tokuhirom
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/perl/latest/bin/:/Users/tokuhirom/perl5/perlbrew/bin:/Users/tokuhirom/perl5/perlbrew/perls/perl-5.14.2/bin:/Users/tokuhirom/perl5/bin/:/Users/tokuhirom/dotfiles/local/bin/:/Users/tokuhirom/bin:/Users/tokuhirom/local/bin/:/usr/local/mysql/bin/:/usr/local/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/perl/latest/bin/:/Users/tokuhirom/perl5/bin/:/Users/tokuhirom/dotfiles/local/bin/:/Users/tokuhirom/bin:/Users/tokuhirom/local/bin/:/usr/local/mysql/bin/:/usr/local/bin/:/Users/tokuhirom/.rvm/bin:/Users/tokuhirom/.rvm/bin
    PERL5OPT=-Mlib=/Users/tokuhirom/perl5/lib/perl5/
    PERLBREW_BASHRC_VERSION=0.42
    PERLBREW_HOME=/Users/tokuhirom/.perlbrew
    PERLBREW_PATH=/Users/tokuhirom/perl5/perlbrew/bin:/Users/tokuhirom/perl5/perlbrew/perls/perl-5.14.2/bin
    PERLBREW_PERL=perl-5.14.2
    PERLBREW_ROOT=/Users/tokuhirom/perl5/perlbrew
    PERLBREW_VERSION=0.30
    PERL_BADLANG (unset)
    PERL_CPANM_OPT=-nv --no-man-pages -l /Users/tokuhirom/perl5/
    SHELL=/bin/zsh


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