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

Memleak in Perl_sv_grow in 5.16+ #12563

Closed
p5pRT opened this issue Nov 15, 2012 · 5 comments
Closed

Memleak in Perl_sv_grow in 5.16+ #12563

p5pRT opened this issue Nov 15, 2012 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 15, 2012

Migrated from rt.perl.org#115738 (status was 'rejected')

Searchable as RT115738$

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2012

From @vovkasm

This fragment is the constant growth of memory (this reduced showcase
from Hash​::Merge code)​:

while (1) {
  my $o = bless {}, 'main';
  test({});
  $o->test;
}
sub test { &test2; }
sub test2 { ref($_[0]) && eval { $_[0]->isa(__PACKAGE__) }; }

If I change "while" to "for (1..100)" and run with valgrind then I got this​:
==29948== 1,584 bytes in 99 blocks are definitely lost in loss record 238 of 263
==29948== at 0x4C2B3F8​: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29948== by 0x478CF4​: Perl_safesysmalloc (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x4A71ED​: Perl_sv_grow (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x4A84CF​: Perl_sv_setpv (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x4A2FA1​: Perl_sv_ref (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x4B0B19​: Perl_pp_ref (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x493A02​: Perl_runops_standard (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x439F4F​: perl_run (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)
==29948== by 0x41F34C​: main (in
/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin/perl)

* bug exists​: threaded and nonthreaded perls versions 5.16.1 and 5.16.2
* bug not exists​: nonthreaded 5.14.2

one of my perl -V output​:
Summary of my perl5 (revision 5 version 16 subversion 1) configuration​:

  Platform​:
  osname=linux, osvers=3.2.0-31-generic, archname=x86_64-linux
  uname='linux vovkasm-wrk 3.2.0-31-generic #50-ubuntu smp fri sep 7
16​:16​:45 utc 2012 x86_64 x86_64 x86_64 gnulinux '
  config_args='-de
-Dprefix=/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads
-Uusethreads'
  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.6.3', 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/x86_64-linux-gnu /lib/../lib
/usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
  libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.15'
  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'

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 Sep 10 2012 16​:06​:36
  %ENV​:
  PERLBREW_BASHRC_VERSION="0.43"
  PERLBREW_HOME="/home/vovkasm/.perlbrew"
  PERLBREW_MANPATH="/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/man"
  PERLBREW_PATH="/home/vovkasm/perl5/perlbrew/bin​:/home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/bin"
  PERLBREW_PERL="perl-5.16.1-nothreads"
  PERLBREW_ROOT="/home/vovkasm/perl5/perlbrew"
  PERLBREW_VERSION="0.43"
  @​INC​:
  /home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/lib/site_perl/5.16.1/x86_64-linux
  /home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/lib/site_perl/5.16.1
  /home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/lib/5.16.1/x86_64-linux
  /home/vovkasm/perl5/perlbrew/perls/perl-5.16.1-nothreads/lib/5.16.1
  .

--
Vladimir Timofeev <vovkasm@​gmail.com>

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2012

From @cpansprout

On Thu Nov 15 00​:05​:57 2012, vovkasm wrote​:

This fragment is the constant growth of memory (this reduced showcase
from Hash​::Merge code)​:

while (1) {
my $o = bless {}, 'main';
test({});
$o->test;
}
sub test { &test2; }
sub test2 { ref($_[0]) && eval { $_[0]->isa(__PACKAGE__) }; }

The leak seems to have disappeared somewhere between 7e2a0d4 and
39984de, but I don’t know exactly which commit is responsible.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2013

From @jkeenan

On Thu Nov 15 06​:11​:23 2012, sprout wrote​:

On Thu Nov 15 00​:05​:57 2012, vovkasm wrote​:

This fragment is the constant growth of memory (this reduced showcase
from Hash​::Merge code)​:

while (1) {
my $o = bless {}, 'main';
test({});
$o->test;
}
sub test { &test2; }
sub test2 { ref($_[0]) && eval { $_[0]->isa(__PACKAGE__) }; }

The leak seems to have disappeared somewhere between 7e2a0d4 and
39984de, but I don’t know exactly which commit is responsible.

I read Father C's comment to mean that the problem has been resolved. Since there has been no further correspondence in this ticket in more than a year, I am closing this ticket.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2013

@jkeenan - Status changed from 'open' to 'rejected'

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