|
From: Fredrik T. <fr...@do...> - 2004-01-14 00:54:18
Attachments:
valgrind-circcheck.patch
|
Since I use valgrind very much for detecting malloc leaks, I found very quickly that it doesn't find blocks that are really lost if they contain pointers to each other (ie. circular references). So, I added functionality in the leak checker to detect circular references. It works by keeping a list of references to other malloc blocks for each block, and then detects which are reachable from outside malloc'ed blocks (such as the .data segment). All that can't be reached from there directly or via a chain of other blocks are considered lost. From my tests, it seems to be working fine, so I thought I'd submit the patch to you. The patch isn't against the CVS, though. Is that OK with you, or do you want me to remake it? It's not very large; just about 250 lines. Fredrik Tolf |
|
From: Dirk M. <dm...@gm...> - 2004-01-14 15:16:46
|
On Wednesday 14 January 2004 01:54, Fredrik Tolf wrote: > Since I use valgrind very much for detecting malloc leaks, I found > very quickly that it doesn't find blocks that are really lost if they > contain pointers to each other (ie. circular references). Can you please open a report on http://valgrind.kde.org/bugs.html and attach your patch so that it is not forgotten? Thanks in advance. |
|
From: Fredrik T. <fr...@do...> - 2004-01-14 15:57:08
|
Dirk Mueller writes: > On Wednesday 14 January 2004 01:54, Fredrik Tolf wrote: > > > Since I use valgrind very much for detecting malloc leaks, I found > > very quickly that it doesn't find blocks that are really lost if they > > contain pointers to each other (ie. circular references). > > Can you please open a report on > > http://valgrind.kde.org/bugs.html > > and attach your patch so that it is not forgotten? Thanks in advance. Ah, sure. I hadn't seen the bugzilla. |
|
From: Julian S. <js...@ac...> - 2004-01-15 00:24:07
|
Hi Frederik, list,
It's a nice-looking patch. It would be even nicer if it had the
relavent documentation updates too :-) {hint}
One question I have is, how useful is the ability to track circular
references during leak checking? Is it something that people widely
want?
J
> > Can you please open a report on
> >
> > http://valgrind.kde.org/bugs.html
> >
> > and attach your patch so that it is not forgotten? Thanks in advance.
>
> Ah, sure. I hadn't seen the bugzilla.
|