|
From: Bryan M. <om...@br...> - 2005-11-03 19:36:10
|
$ valgrind --tool=omega ./simple1
==13235== Omega, An instant memory leak detector.
==13235== Copyright (C) 2005, and GNU GPL'd, by Bryan Meredith.
==13235== Using LibVEX rev 1419, a library for dynamic binary translation.
==13235== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==13235== Using valgrind-3.1.SVN, a dynamic binary instrumentation framework.
==13235== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==13235== For more details, rerun with: -v
==13235==
==13235== Omega:Leak detected!!!
==13235== Leaking block of 64 bytes
==13235== at 0x8048383: main (simple1.c:9)
==13235== Block allocated:
==13235== at 0x401B3A9: malloc (vg_replace_malloc.c:149)
==13235== by 0x804837C: main (simple1.c:8)
==13235==
$ cat simple1.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char *fred = 0;
fred = malloc(64);
fred = 0;
return 0;
}
Thought that I should share this with you.
I appreciate that there is still a long way to go but at least it isnt
complete vapourware anymore :D
I have to implement die_stack and share the functionality so I can trap leaks
of pointers within allocated blocks that are free()d. Once that is done, I
will post the code for you to laugh at and really go to town on.
Bryan "Brain Murders" Meredith
|
|
From: Nicholas N. <nj...@cs...> - 2005-11-03 20:03:39
|
On Thu, 3 Nov 2005, Bryan Meredith wrote: > ==13235== Omega:Leak detected!!! > ==13235== Leaking block of 64 bytes > ==13235== at 0x8048383: main (simple1.c:9) > ==13235== Block allocated: > ==13235== at 0x401B3A9: malloc (vg_replace_malloc.c:149) > ==13235== by 0x804837C: main (simple1.c:8) > > Thought that I should share this with you. > I appreciate that there is still a long way to go but at least it isnt > complete vapourware anymore :D Nice! It looks like it hasn't taken you too long to make some progress, that is good to see. Let us know if there is anything that you found particularly confusing or stupid about writing tools. A minor nitpick... I'd make the message look more like this: > ==13235== Leaking block of 64 bytes > ==13235== at 0x8048383: main (simple1.c:9) > ==13235== Block at 0xABCD allocated > ==13235== at 0x401B3A9: malloc (vg_replace_malloc.c:149) > ==13235== by 0x804837C: main (simple1.c:8) but hey, it's your code. > I have to implement die_stack and share the functionality so I can trap leaks > of pointers within allocated blocks that are free()d. Once that is done, I > will post the code for you to laugh at and really go to town on. Keep up the good work. N |
|
From: Bryan M. <om...@br...> - 2005-11-03 20:15:20
|
On Thursday 03 Nov 2005 20:03, Nicholas Nethercote wrote: > On Thu, 3 Nov 2005, Bryan Meredith wrote: > > > ==13235== Omega:Leak detected!!! > > ==13235== Leaking block of 64 bytes > > ==13235== at 0x8048383: main (simple1.c:9) > > ==13235== Block allocated: > > ==13235== at 0x401B3A9: malloc (vg_replace_malloc.c:149) > > ==13235== by 0x804837C: main (simple1.c:8) > > > > Thought that I should share this with you. > > I appreciate that there is still a long way to go but at least it isnt > > complete vapourware anymore :D > > Nice! It looks like it hasn't taken you too long to make some progress, > that is good to see. Let us know if there is anything that you found > particularly confusing or stupid about writing tools. > > A minor nitpick... I'd make the message look more like this: > > > ==13235== Leaking block of 64 bytes > > ==13235== at 0x8048383: main (simple1.c:9) > > ==13235== Block at 0xABCD allocated > > ==13235== at 0x401B3A9: malloc (vg_replace_malloc.c:149) > > ==13235== by 0x804837C: main (simple1.c:8) > > but hey, it's your code. Changed to match your suggestion - twiddling white space is a bug fix I can cope with :P Bryan "Brain Murders" Meredith |