debugperl and Devel::Leak funkiness

If you’ve ever tried to use Devel::Leak to debug some perl memory leaks on debian, and found¬†that sv_dump doesnt actually output anything useful for you then try the following:

apt-get install debugperl

then, download Devel::Perl from cpan, untar and build with the following magic:

debugperl Makefile.PL DEFINE=-DDEBUGGING

As ¬†Brendan O’dea (or bod of l2tpns fame) from down under puts it quite succinctly:

The perl-*-debug package provides a debug-enabled binary as debugperl. It does not however include either the config.h or Config.pm which were which match that binary. This is not generally a problem if you just want to debug from the command line (“debugperl -D…”).

Devel::Leak however uses the former (config.h) in the .xs to determine
whether or not to use sv_dump, and the latter (Config.pm) to warn about
-DDEBUGGING in the Makefile.PL.

 

Hopefully this helps someone else googling.

Author: roelf on July 14, 2011
Category: Debian, Unix Development
Tags: , , ,

Leave a Reply

*

Last articles