valgrind (was: Re: [Gllug] Compiling a Kernel)

Stig Brautaset stigbrau at start.no
Mon May 27 23:32:27 UTC 2002


* Dave Jones <davej at suse.de> spake thus:
> Also, going off on a complete tangent, if you're a C/C++ programmer,
> and you haven't seen valgrind yet, run (don't walk) to the homepage[1]
> immediately and grab a copy.  It's like electric fence on steroids,
> and has turned up lots of bugs in numerous bits of code I thought were
> completely problem free.

Thanks, methinks I will have much fun with this program :) It seems
*very* usefull, but after it found so many errors in ls I was a bit
dubious about running it on one of my own programs...  I had to do it
anyway though, just ran it on my ncurses pacman (wannabe) clone, and the
only leaks it found was in the ncurses subsystem :D Me is a happy sheep :)

stig at arwen:~/pac$ valgrind --leak-check=yes ./pac
==10840== valgrind-20020511, a memory error detector for x86 GNU/Linux.
==10840== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==10840== Estimated CPU clock rate is 499 MHz
==10840== For more details, rerun with: -v
==10840== 
Board size: rows=29, cols=71
Read location info: 2059 non-blank positions
Starting ncurses gui subsystem.

Killing ncurses windows.
Pac 2002, Stig Brautaset.

==10840== 
==10840== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==10840== malloc/free: in use at exit: 96329 bytes in 327 blocks.
==10840== malloc/free: 2418 allocs, 2091 frees, 121189 bytes allocated.
==10840== For counts of detected errors, rerun with: -v
==10840== searching for pointers to 327 not-freed blocks.
==10840== checked 4633568 bytes.
==10840== 
==10840== definitely lost: 0 bytes in 0 blocks.
==10840== possibly lost:   0 bytes in 0 blocks.
==10840== still reachable: 96329 bytes in 327 blocks.
==10840== 
==10840== LEAK SUMMARY:
==10840==    possibly lost:   0 bytes in 0 blocks.
==10840==    definitely lost: 0 bytes in 0 blocks.
==10840==    still reachable: 96329 bytes in 327 blocks.
==10840== Reachable blocks (those to which a pointer was found) are not shown.
==10840== To see them, rerun with: --show-reachable=yes
==10840== 


Stig
-- 
brautaset.org


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list