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

Carp leaking memory #11579

Closed
p5pRT opened this issue Aug 15, 2011 · 13 comments
Closed

Carp leaking memory #11579

p5pRT opened this issue Aug 15, 2011 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 15, 2011

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

Searchable as RT97010$

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2011

From perlbug@plan9.de

Created by perlbug@plan9.de

Carp​::shortmess/longmess leak memory, and as a result all functions in the
Carp module. It doesn'T seem to be hard to trigger​:

  perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

Perl Info

Flags:
    category=library
    severity=medium
    module=Carp

Site configuration information for perl 5.12.4:

Configured by Marc Lehmann at Sun Aug 14 14:59:28 CEST 2011.

Summary of my perl5 (revision 5 version 12 subversion 4) configuration:
   
  Platform:
    osname=linux, osvers=2.6.39-2-amd64, archname=x86_64-linux
    uname='linux cerebro 2.6.39-2-amd64 #1 smp tue jul 5 02:51:22 utc 2011 x86_64 gnulinux '
    config_args='-Duselargefiles -Duse64bitint -Dusemymalloc=n -Dstatic_ext=Fcntl -Dcc=gcc -Dccflags=-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -USITEARCH_EXP -USITELIB_EXP -UARCHLIB_EXP -D_GNU_SOURCE  -I/opt/include -ggdb -gdwarf-2 -g3 -Doptimize=-O6 -fno-strict-aliasing -Dcccdlflags=-fPIC -Dldflags=-L/opt/perl/lib -L/opt/lib -Dlibs=-ldl -lm -lcrypt -lgdbm -Dprefix=/opt/perl -Dprivlib=/opt/perl/lib/perl5 -Darchlib=/opt/perl/lib/perl5 -Uusevendorprefix -Dsiteprefix=/opt/perl -Dsitelib=/opt/perl/lib/perl5 -Dsitearch=/opt/perl/lib/perl5 -Dsitebin=/opt/perl/bin -Dman1dir=/opt/perl/man/man1 -Dman3dir=/opt/perl/man/man3 -Dsiteman1dir=/opt/perl/man/man1 -Dsiteman3dir=/opt/perl/man/man3 -Dman1ext=1 -Dman3ext=3 -Dpager=/usr/bin/less -Uafs -Uusesfio -Uusenm -Uuseshrplib -Ud_dosuid -Dusethreads=undef -Duse5005threads=undef -Duseithreads=undef -Dusemultiplicity=undef -Demail=perl-binary@plan9.de -Dcf_email=perl-binary@plan9.de -Dcf_by=Marc Lehmann -Dlocincpth=/opt/perl/include /opt/include -Dmyhostname=localhost -Dmultiarch=undef -Dbin=/opt/perl/bin -Dxxxusedevel -DxxxDEBUGGING -Dxxxuse_debugging_perl -Dxxxuse_debugmalloc -dEs'
    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='gcc', ccflags ='-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -USITEARCH_EXP -USITELIB_EXP -UARCHLIB_EXP -D_GNU_SOURCE -I/opt/include -ggdb -gdwarf-2 -g3 -fno-strict-aliasing -pipe -I/opt/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O6 -fno-strict-aliasing',
    cppflags='-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -USITEARCH_EXP -USITELIB_EXP -UARCHLIB_EXP -D_GNU_SOURCE -I/opt/include -ggdb -gdwarf-2 -g3 -fno-strict-aliasing -pipe -I/opt/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='gcc', ldflags ='-L/opt/perl/lib -L/opt/lib -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=-ldl -lm -lcrypt -lgdbm
    perllibs=-ldl -lm -lcrypt
    libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O6 -fno-strict-aliasing -L/opt/perl/lib -L/opt/lib -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.12.4:
    /root/src/sex
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    .


Environment for perl 5.12.4:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/root/s2:/root/s:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/root/pserv:.
    PERL5LIB=/root/src/sex
    PERL5_CPANPLUS_CONFIG=/root/.cpanplus/config
    PERLDB_OPTS=ornaments=0
    PERL_ANYEVENT_DBI_TESTS=1
    PERL_ANYEVENT_DEBUG_SHELL=unix/:/tmp/debug$$.sock
    PERL_ANYEVENT_DEBUG_WRAP=2
    PERL_ANYEVENT_EDNS0=1
    PERL_ANYEVENT_LOOP_TESTS=1
    PERL_ANYEVENT_NET_TESTS=1
    PERL_ANYEVENT_PROTOCOLS=ipv4,ipv6
    PERL_ANYEVENT_STRICT=1
    PERL_BADLANG (unset)
    PERL_UNICODE=E
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2011

From @cpansprout

This appears to be a regression in 5.12.2.

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2011

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

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2011

From @cpansprout

9770594 is the first bad commit
commit 9770594
Author​: Nicholas Clark <nick@​ccl4.org>
Date​: Wed Jul 21 20​:17​:47 2010 +0100

  Detect incomplete caller overrides in Carp, and avoid using bogus
@​DB​::args.
 
  To get arguments into its backtraces, Carp relies on caller setting
@​DB​::args
  when called from package DB. @​DB​::args isn't refcounted (and can't
be). Not
  all overriders of &CORE​::GLOBAL​::caller set @​DB​::args properly, with
the result
  that @​DB​::arg can become "stale", with strange errors, at a distance.
 
  However, it is possible to detect that @​DB​::args has not been
updated, and take
  evasive action. This is preferable to presenting the user (or
logfile) with
  silently wrong backtraces, and much preferable to the occasional
"Bizarre copy"
  exception.

:040000 040000 68b668f970ec831828fb472841aeb1d951d42e1b
c59e458f2a7395a3e67105ac9acc8b27dadf9231 M lib

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2011

From [Unknown Contact. See original ticket]

9770594 is the first bad commit
commit 9770594
Author​: Nicholas Clark <nick@​ccl4.org>
Date​: Wed Jul 21 20​:17​:47 2010 +0100

  Detect incomplete caller overrides in Carp, and avoid using bogus
@​DB​::args.
 
  To get arguments into its backtraces, Carp relies on caller setting
@​DB​::args
  when called from package DB. @​DB​::args isn't refcounted (and can't
be). Not
  all overriders of &CORE​::GLOBAL​::caller set @​DB​::args properly, with
the result
  that @​DB​::arg can become "stale", with strange errors, at a distance.
 
  However, it is possible to detect that @​DB​::args has not been
updated, and take
  evasive action. This is preferable to presenting the user (or
logfile) with
  silently wrong backtraces, and much preferable to the occasional
"Bizarre copy"
  exception.

:040000 040000 68b668f970ec831828fb472841aeb1d951d42e1b
c59e458f2a7395a3e67105ac9acc8b27dadf9231 M lib

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2011

From @cpansprout

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Can this be backported to both maint branches?

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2011

From [Unknown Contact. See original ticket]

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Can this be backported to both maint branches?

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2011

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

@p5pRT p5pRT closed this as completed Aug 18, 2011
@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2011

From @cpansprout

On Thu Aug 18 08​:59​:25 2011, sprout wrote​:

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Oops. I got the wrong bug number in the commit message.

Can this be backported to both maint branches?

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2011

From [Unknown Contact. See original ticket]

On Thu Aug 18 08​:59​:25 2011, sprout wrote​:

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Oops. I got the wrong bug number in the commit message.

Can this be backported to both maint branches?

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2011

From @rafl

"Father Chrysostomos via RT" <perlbug-comment@​perl.org> writes​:

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.

This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Can this be backported to both maint branches?

I think this is important and would love to pull it in for 5.14.2, but
there's only two +1s right now. Could anyone else please review it as
well?

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2011

From @chipdude

On 8/26/2011 3​:31 AM, Florian Ragwitz wrote​:

"Father Chrysostomos via RT" <perlbug-comment@​perl.org> writes​:

On Mon Aug 15 07​:16​:05 2011, perlbug@​plan9.de wrote​:

Carp​::shortmess/longmess leak memory, and as a result all functions in
the
Carp module. It doesn'T seem to be hard to trigger​:

perl -e 'use Carp; Carp​::shortmess while 1'

This leaks about 12mb/s on my system. When using longmess and a longer
backtrace is generated, it leaks faster.
This was broken in perl 5.12.2 and 5.14.0.

I have just fixed it with commit af80dd8.

Can this be backported to both maint branches?
I think this is important and would love to pull it in for 5.14.2, but
there's only two +1s right now. Could anyone else please review it as
well?

+1

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2011

From @rafl

Reverend Chip <rev.chip@​gmail.com> writes​:

On 8/26/2011 3​:31 AM, Florian Ragwitz wrote​:

"Father Chrysostomos via RT" <perlbug-comment@​perl.org> writes​:

I have just fixed it with commit af80dd8.

Can this be backported to both maint branches?
I think this is important and would love to pull it in for 5.14.2, but
there's only two +1s right now. Could anyone else please review it as
well?

+1

Thanks. Tux also gave me a +1 on IRC.

Just pulled it down to maint-5.14, along with a perldelta entry.

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