Hi,
Can anyone out there help with this strange problem.
The program in question is fairly complex (threads & forks) and part
built from binary-only libraries. It has a memory leak but no
(obvious) memory corruption or other runtime problems.
I'm running on Linux.
My mpatrol options are: CHECKFORK NOPROTECT LEAKTABLE SHOWUNFREED
AUTOSAVE=30
If I run it with mpatrol, it segfaults. It also does this if I run it
in gdb with mpatrol (dynamic preloaded library):
Program received signal SIGSEGV, Segmentation fault.
0x400209a8 in getaddr () from /usr/lib/libmpatrolmt.so
(gdb) bt
#0 0x400209a8 in getaddr () from /usr/lib/libmpatrolmt.so
#1 0x40020a2b in __mp_getframe () from /usr/lib/libmpatrolmt.so
#2 0x40020c7d in __mp_getaddrs () from /usr/lib/libmpatrolmt.so
#3 0x4001e695 in __mp_getmemory () from /usr/lib/libmpatrolmt.so
#4 0x4002bf5b in __mp_alloc () from /usr/lib/libmpatrolmt.so
#5 0x400300b3 in malloc () from /usr/lib/libmpatrolmt.so
If I set a breakpoint on malloc and then do a backtrace and continue
at that breakpoint, gdb is consistent in that it just shows (twice)
immediately before the segfault:
Breakpoint 2, 0x4003008c in malloc () from /usr/lib/libmpatrolmt.so
#0 0x4003008c in malloc () from /usr/lib/libmpatrolmt.so
Breakpoint 2, 0x4003008c in malloc () from /usr/lib/libmpatrolmt.so
#0 0x4003008c in malloc () from /usr/lib/libmpatrolmt.so
This is completely repeatable.
If I run with strace, then I just get output consisting of 100,000's
of pairs of lines like this:
29158 rt_sigaction(SIGBUS, {0x400e4540, [BUS], SA_RESTORER|SA_RESTART,
0x40c0bcf8}, {0x400e4540, [BUS], SA_RESTORER|SA_RESTART, 0x40c0bcf8},
8) = 0
29158 rt_sigaction(SIGSEGV, {0x400e4540, [SEGV],
SA_RESTORER|SA_RESTART, 0x40c0bcf8}, {0x400e4540, [SEGV],
SA_RESTORER|SA_RESTART, 0x40c0bcf8}, 8) = 0
Can anyone help with this?
Thanks,
Andy