Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak evaluating version objects in boolean context #11932

Closed
p5pRT opened this issue Feb 4, 2012 · 4 comments
Closed

Memory leak evaluating version objects in boolean context #11932

p5pRT opened this issue Feb 4, 2012 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 4, 2012

Migrated from rt.perl.org#109762 (status was 'resolved')

Searchable as RT109762$

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2012

From @xdg

Created by @xdg

I've found a memory leak when a version object is evaluated
in boolean context.

Can be replicated with this one-liner​:

perl -Mversion -wE \
  'while (1) { my $v = version->new("1.23"); my $b = !!$v }'

Run it and watch your free memory disappear.

Confirmed in blead and 5.14 on linux. Others on #p5p observed it on
other platforms and perls, including Windows and 5.12.

Perl Info

Flags:
    category=library
    severity=high
    module=version

Site configuration information for perl 5.14.0:

Configured by david at Mon Jun  6 22:42:49 EDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=2.6.35-28-generic, archname=x86_64-linux
    uname='linux icarus 2.6.35-28-generic #50-ubuntu smp fri mar 18 18:42:20 utc 2011 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/david/perl5/perlbrew/perls/perl-5.14.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-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.5', 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='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib/x86_64-linux-gnu /lib64 /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.12.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.12.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.14.0:
    /home/david/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/x86_64-linux
    /home/david/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0
    /home/david/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0/x86_64-linux
    /home/david/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0
    .


Environment for perl 5.14.0:
    HOME=/home/david
    LANG=en_US.utf8
    LANGUAGE (unset)
    LC_COLLATE=C
    LC_CTYPE=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=~/git/utility-scripts/:/home/david/perl5/perlbrew/bin:/home/david/perl5/perlbrew/perls/perl-5.14.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:.
    PERLBREW_BASHRC_VERSION=0.36
    PERLBREW_HOME=/home/david/.perlbrew
    PERLBREW_PATH=/home/david/perl5/perlbrew/bin:/home/david/perl5/perlbrew/perls/perl-5.14.0/bin
    PERLBREW_PERL=perl-5.14.0
    PERLBREW_ROOT=/home/david/perl5/perlbrew
    PERLBREW_VERSION=0.23
    PERL_BADLANG (unset)
    PERL_EXTUTILS_AUTOINSTALL=--defaultdeps
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2012

From @cpansprout

On Fri Feb 03 20​:25​:30 2012, dagolden@​cpan.org wrote​:

This is a bug report for perl from dagolden@​cpan.org,
generated with the help of perlbug 1.39 running under perl 5.14.0.

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

I've found a memory leak when a version object is evaluated
in boolean context.

Can be replicated with this one-liner​:

perl -Mversion -wE \
'while (1) { my $v = version->new("1.23"); my $b = !!$v }'

Run it and watch your free memory disappear.

Confirmed in blead and 5.14 on linux. Others on #p5p observed it on
other platforms and perls, including Windows and 5.12.

I’ve just fixed it in commit bcb2959.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2012

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2012

@cpansprout - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant