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

Re: [PATCH] PERL_MEM_LOG option for C backtrace

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
January 21, 2019 21:13
Subject:
Re: [PATCH] PERL_MEM_LOG option for C backtrace
Message ID:
20190121211321.4dc6a3f8@shy.leonerd.org.uk
On Mon, 21 Jan 2019 13:47:33 -0600
"Craig A. Berry" <craig.a.berry@gmail.com> wrote:

> On Mon, Jan 21, 2019 at 10:29 AM Paul "LeoNerd" Evans
> <leonerd@leonerd.org.uk> wrote:
> >
> > On Mon, 21 Jan 2019 11:18:58 -0500
> > James E Keenan <jkeenan@pobox.com> wrote:
> >  
> > > Commit will need a better commit message.  The patch itself is
> > > outside of my expertise for commenting on; others will have to
> > > review.  
> >
> > How about:
> >
> >   Add PERL_MEM_LOG=c... for C backtrace logging
> >
> >   Adds a new flag, 'c' to the PERL_MEM_LOG option. When present, any
> >   newSV() or related call will additionally log 3 levels of
> > backtrace from the C call stack, which may help further identify
> > the code location responsible for generating leaking SVs.  
> 
> If one line doesn't tell you anything and 3 lines do, that makes sense
> to me, but I think all of your code after the call to
> Perl_get_c_backtrace needs to be wrapped in:

Without that option you didn't get any amount of C backtrace; only the
(static) calling function name that appeared by the magic of macros.

> if (bt != NULL) {
> . . .
> }
> 
> because otherwise you'll be dereferencing a NULL pointer on platforms
> that do not have the non-standard backtrace calls.

Ah; yes that's a point. I'll do that.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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