develooper Front page | perl.perl5.porters | Postings from June 2022

PERL_MEM_LOG - broken and useless

Thread Next
Paul "LeoNerd" Evans
June 9, 2022 17:19
PERL_MEM_LOG - broken and useless
Message ID:
I've been trying to track down a tricky memory-leak bug, so I thought
I'd have a go at using the PERL_MEM_LOG machinery.

Turns out: it's broken and doesn't work; and even if it were to work it
would be borderline-useless.

 * Broken: Attempting to actually use it causes a snprintf buffer

    $ PERL_MEM_LOG=s bleadperl
    panic: snprintf buffer overflow at /home/leo/perl5/perlbrew/perls/bleadperl/lib/5.37.1/ line 112.
    Compilation failed in require.
    BEGIN failed--compilation aborted.

 * Useless: Before it failed, it did print lots of SV creation logs;
   almost every one of them giving the caller location as
   Perl_newSV_type at sv_inline.h line 369 (apart from a scattered few
   that show Perl_sv_newmortal()).

   So even if I fix the snprintf bug, I'll still end up with a log that
   doesn't contain useful information.

This all sounds somewhat familiar to me - turns out I ran into this
second part 3 years ago and came up with a solution. I posted a patch
at the time that didn't end up going anywhere:

I'll have a go at resurrecting that patch and making it work on current
blead; if I can make it work expect a PR to add it here.

Paul "LeoNerd" Evans      |  |

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