develooper Front page | perl.perl5.porters | Postings from January 2019

Re: [PATCH] PERL_MEM_LOG option for C backtrace

Thread Previous | Thread Next
From:
James E Keenan
Date:
January 14, 2019 00:16
Subject:
Re: [PATCH] PERL_MEM_LOG option for C backtrace
Message ID:
20190114001606.5645.qmail@lists-nntp.develooper.com
On 1/13/19 6:32 PM, Paul "LeoNerd" Evans wrote:
> For the full story, see
>    http://leonerds-code.blogspot.com/2018/09/develmat-investigation-into-c-part-2.html
> 
> In summary:
> 
>    PERL_MEM_LOG=s ...
>    new_SV: sv.c:9753:Perl_newSVsv: 564e10091f80
> 
> is almost useless, because 9 times in 10 it just reports that
> Perl_newSVsv was the cause of my newly created (and now leaking) SV. I
> could have guessed this. I want to know what called it.
> 
> My patch adds
> 
>    PERL_MEM_LOG=sc ...
> 
> thus giving the output a (currently-hardcoded) 3 levels of C backtrace:
> 
>    new_SV: sv.c:9753:Perl_newSVsv: 55f72bd4b4f0
>      frame[0]: 0x55f72a04d4c3 Perl_newSVsv at /home/leo/perl5/perlbrew/build/perl-5.26.2/perl-5.26.2/perl +0x16d4c3
>      frame[1]: 0x7f4644e5af73 - at /home/leo/perl5/perlbrew/perls/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/auto/Net/SSLeay/SSLeay.so +0x78f73
>      frame[2]: 0x55f72a019082 Perl_pp_entersub at /home/leo/perl5/perlbrew/build/perl-5.26.2/perl-5.26.2/perl +0x139082
> 
> I can now use this
> 
>    $ addr2line -fe /home/leo/perl5/perlbrew/perls/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/auto/Net/SSLeay/SSLeay.so 0x78f73
>    XS_Net__SSLeay_CTX_set_tlsext_status_cb
>    /home/leo/.cpan/build/Net-SSLeay-1.85-1/SSLeay.xs:6453
> 
> Open to suggestions...
> 

A patch drawn against perl 5 blead (rather than 5.26.2) would be easier 
to evaluate.

Thank you very much.
Jim Keenan

Thread Previous | 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