develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #118829] Storable. Memory leaks in STORABLE_attach

From:
Vladimir Timofeev
Date:
July 9, 2013 23:16
Subject:
[perl #118829] Storable. Memory leaks in STORABLE_attach
Message ID:
rt-3.6.HEAD-2552-1373411782-1858.118829-75-0@perl.org
# New Ticket Created by  Vladimir Timofeev 
# Please include the string:  [perl #118829]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118829 >


Storable 2.39 (on CPAN),
Storable 2.41 (perl-5.18.0 tag from perl5.git.perl.org),
Storable 2.43 (from blead)

All have a memory leaks when user use STORABLE_attach hook.
I place version 2.39 from CPAN to gitgub repository
https://github.com/vovkasm/p5-Storable
and
1. Add test for this leaks
2. Fix some (or all) of them

Also, just in case, attaching a full patch.

My perl -V output (but again it is not perl, it is Storable... at work
I can see this bug on 5.14 on freebsd and linux servers):
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:

  Platform:
    osname=linux, osvers=3.7.10-1-arch, archname=x86_64-linux
    uname='linux vov.home 3.7.10-1-arch #1 smp preempt thu feb 28
09:50:17 cet 2013 x86_64 gnulinux '
    config_args='-de
-Dprefix=/home/vovkasm/perl5/perlbrew/perls/perl-5.16.3 -Dcc=clang
-Dcpp=clang-cpp -Doptimize=-O3 -march=native -g -Uusethreads
-Aeval:scriptdir=/home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/bin'
    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='clang', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -march=native -g',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 Compatible Clang 3.2
(tags/RELEASE_32/final)', 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='clang', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib
/lib64 /usr/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.17'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O3 -march=native -g
-L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
                        USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
                        USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Mar 14 2013 02:59:02
  %ENV:
    PERLBREW_BASHRC_VERSION="0.64"
    PERLBREW_HOME="/home/vovkasm/.perlbrew"
    PERLBREW_MANPATH="/home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/man"
    PERLBREW_PATH="/home/vovkasm/perl5/perlbrew/bin:/home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/bin"
    PERLBREW_PERL="perl-5.16.3"
    PERLBREW_ROOT="/home/vovkasm/perl5/perlbrew"
    PERLBREW_VERSION="0.64"
  @INC:
    /home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux
    /home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3
    /home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux
    /home/vovkasm/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3
    .

--
Vladimir Timofeev <vovkasm@gmail.com>



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