This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
mtrace: Alloc duplicate
- From: Martin Brandenburg <martin at omnibond dot com>
- To: libc-help at sourceware dot org
- Date: Thu, 15 May 2014 10:45:39 -0400
- Subject: mtrace: Alloc duplicate
- Authentication-results: sourceware.org; auth=none
I am using mtrace to debug memory leaks in a program. I am getting
output of the following form from mtrace:
+ 0x00000000024097d0 Alloc 1219709 duplicate: 0x4b372b
/opt/orangefs/sbin/pvfs2-server:(dbpf_queued_op_alloc+0xe)[0x4b372b]
Reading the raw log it looks like the same pointer is allocated twice.
The program is multi-threaded, so I've thought about that as a reason.
There are some notes that mtrace(3) uses malloc_hook(3) and that
malloc_hook does not work well in a multithreaded environment. Is this
the cause of the problem? Does this output indicate a bug in my program
or just a problem with mtrace in multithreaded systems? The rest of the
output is still useful.
(I'm not on the list, please make sure I'm cc'd in any replies.)
- Martin