perl-Devel-Plumber - memory leak finder for C programs
||ALT Linux Sisyphus
Devel::Plumber is a memory leak finder for C programs, implemented in
Perl. It uses GDB to walk internal glibc heap structures, so it can
work on either a live process or a core file.
Devel::Plumber treats the C heap of the program under test as a
collection of non-overlapping blocks, and classifies them into
one of four states.
The block is not allocated.
The block is allocated but there are no pointers to any address in it,
so the program cannot reach it.
=item Maybe Leaked
The block is allocated and there are pointers to addresses within it,
but no pointers to the start of it. The program might be able to reach
it in some unobvious way via those pointers (e.g. using pointer
arithmetic), or the pointers may be dangling pointers to earlier
generations of blocks. Devel::Plumber cannot tell the difference
between these possibilities.
The block is allocated and there are pointers to the start of the block.
Devel::Plumber proceeds in two main phases. In the first phase, the
glibc internal heap structures are walked to discover all the blocks.
Unallocated blocks are set to Free state at this time and allocated
blocks are initially set to Leaked state. In the second phase,
reachable blocks are marked. All the *.data* and *.bss* sections in
the program (and all loaded shared libraries) are scanned for pointers.
If a pointer points to the start of a block, the block is set to Reached
state; if it points into a Leaked block, the block is set to Maybe
Leaked state. In either case, the block's contents are also scanned for
pointers. After the second phase is complete, any blocks still in
Leaked state are definitely leaked.
- Add the following line to /etc/apt/sources.list:
rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus i586 autoimports
rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
- Update the package index:
# sudo apt-get update
- Install perl-Devel-Plumber rpm package:
# sudo apt-get install perl-Devel-Plumber