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

Re: [PATCH] PERL_MEM_LOG option for C backtrace

Thread Previous | Thread Next
Craig A. Berry
January 21, 2019 19:47
Re: [PATCH] PERL_MEM_LOG option for C backtrace
Message ID:
On Mon, Jan 21, 2019 at 10:29 AM Paul "LeoNerd" Evans
<> wrote:
> On Mon, 21 Jan 2019 11:18:58 -0500
> James E Keenan <> 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:

if (bt != NULL) {
. . .

because otherwise you'll be dereferencing a NULL pointer on platforms
that do not have the non-standard backtrace calls.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About