How to locate a free/delete mismatch reported by Valgrind in a multithreaded program?

Here is the Valgring report:

==14546== Thread 5:
==14546== Invalid free() / delete / delete[]
==14546==    at 0x490555D: free (vg_replace_malloc.c:235)
==14546==    by 0x3BF7EFAA8F: free_mem (in /lib64/tls/libc-2.3.4.so)
==14546==    by 0x3BF7EFA581: __libc_freeres (in /lib64/tls/libc-2.3.4.so)
==14546==    by 0x4802676: _vgw_freeres (vg_preloaded.c:62)
==14546==  Address 0x4DC4EE0 is not stack'd, malloc'd or (recently) free'd

How can I know which thread is it as the thread number varies from one execution to another ? Will assigning names to my threads help here ?

EDIT: I don't think it will as this is mentioned in the DRD section of the manual.

I'm using valgrind-3.1.1 on Red Hat enterprise Linux AS4.

9
задан philant 6 October 2010 в 12:28
поделиться