|
From: Patrick O. <Pat...@in...> - 2004-08-19 06:27:59
|
On Wed, 2004-08-18 at 17:12, Eric Estievenart wrote: > Patrick Ohly wrote: > > >>>perhaps I am missing something obvious, but > >>>is there a possibility to print the address > >>>of a memory block which was leaked in the > >>>report of the leak? I'm using memcheck. > > > > Can you point me in the right direction so that (when > > I find the time) I can provide a patch which does that? > > Would that be accepted into valgrind mainline? > > I don't see why exactly you need the address of > leaked blocks, except if: > - your program logs additional information associated > to the blocks when allocating them, e.g. for a web browser: > block at 0xXYZ allocated when requesting doc http://xxx/zzz This is exactly what I have. > For now, if you are in a hurry, Not any more because after some more searching I found the reason for the leak, and ... > you can have a look > at memcheck/mac_leakcheck.c, and: > - Add an address member in LossRecord structure > - tweak MAC_(pp_LeakError) so as to print it > - tweak MAC_(do_detect_memory_leaks): > - do not compare blocks together > - initialize the address in the LossRecord struct > > (But such a change is likely to be never accepted in > Valgrind, since it is really kludgy !) ... as it wouldn't be considered generally useful I won't bother to change it. -- Best Regards Patrick Ohly Senior Software Engineer Intel GmbH Software & Solutions Group Hermuelheimer Strasse 8a 50321 Bruehl Germany Tel: +49-2232-2090-30 Fax: +49-2232-2090-29 |