lmdbg-leaks - extracts memory leaks from lmdbg-run's output
lmdbg-leaks [OPTIONS] [files...]
lmdbg-leaks analyses lmdbg-run's output and outputs stacktraces
with memory leaks.
- -h
- Display help message.
- -V
- Display the lmdbg version.
$ cat test3.c
#include <stdlib.h>
int main ()
{
void *p1 = NULL;
void *p2 = NULL;
p1 = malloc (555);
p2 = realloc (p2, 666);
free (p1);
return 0;
}
$ cc -O0 -g -o test3 test3.c
$ lmdbg-run -o log ./test3
$ cat log
info section 0x0xbbace000 0x0xbbbc6000 /lib/libc.so.12.179
info section 0x0xbbbdd000 0x0xbbbe1000 /usr/pkg/lib/liblmdbg.so.0.0
info section 0x0xbbbee000 0x0xbbbfe000 /libexec/ld.elf_so
info progname ./test3
malloc ( 555 ) --> 0xbb90a400 num: 1
0xbbbddb7a
0xbbbde53b
0x8048799
0x804866d
0x80486a8
realloc ( NULL , 666 ) --> 0xbb90a800 num: 2
0xbbbddb7a
0xbbbde68c
0x80487b1
0x804866d
0x80486a8
free ( 0xbb90a400 ) num: 3
0xbbbddb7a
0xbbbde785
0x80487c1
0x804866d
0x80486a8
$ lmdbg-leaks log
info section 0x0xbbace000 0x0xbbbc6000 /lib/libc.so.12.179
info section 0x0xbbbdd000 0x0xbbbe1000 /usr/pkg/lib/liblmdbg.so.0.0
info section 0x0xbbbee000 0x0xbbbfe000 /libexec/ld.elf_so
info progname ./test3
realloc ( NULL , 666 ) --> 0xbb90a800 num: 2
0xbbbddb7a
0xbbbde68c
0x80487b1
0x804866d
0x80486a8
$
lmdbg-run -o log ./my_app &&
lmdbg-leaks log > log_leaks &&
lmdbg-sym ./my_app log_leaks > log_leaks2 &&
lmdbg-sysleaks -s log_leaks2 > log_final
lmdbg-run -p 'lmdbg-leaks | lmdbg-sym > log' ./my_app <args>
lmdbg(1), lmdbg-run(1), lmdbg-sym(1), lmdbg-stat(1),
lmdbg-sort(1), lmdbg-grep(1), lmdbg-head(1),
lmdbg-sysleaks(1), lmdbg-strip(1), lmdbg-modules(1)
Aleksey Cheusov <vle@gmx.net>