rom1@laptop ~/Documents/Programmation/C $ cat leak.c #include #include int main() { int *i = malloc(sizeof i); free(i); exit(EXIT_SUCCESS); } rom1@laptop ~/Documents/Programmation/C $ ./valgrind.sh ./leak rom1@laptop ~/Documents/Programmation/C $ cat leak-valgrind.log ==31352== Memcheck, a memory error detector. ==31352== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==31352== Using LibVEX rev 1732, a library for dynamic binary translation. ==31352== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==31352== Using valgrind-3.2.3-Debian, a dynamic binary instrumentation framework. ==31352== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==31352== ==31352== My PID = 31352, parent PID = 31351. Prog and args are: ==31352== ./leak ==31352== --31352-- --31352-- Command line --31352-- ./leak --31352-- Startup, with flags: --31352-- --verbose --31352-- --show-reachable=yes --31352-- --log-file-exactly=./leak-valgrind.log --31352-- --leak-check=full --31352-- --run-libc-freeres=no --31352-- Contents of /proc/version: --31352-- Linux version 2.6.18-4-686 (Debian 2.6.18.dfsg.1-12etch2) (dannf@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Wed May 9 23:03:12 UTC 2007 --31352-- Arch and hwcaps: X86, x86-sse1-sse2 --31352-- Page sizes: currently 4096, max supported 4096 --31352-- Valgrind library directory: /usr/lib/valgrind --31352-- Reading syms from /lib/ld-2.5.so (0x4000000) --31352-- Reading debug info from /lib/ld-2.5.so... --31352-- ... CRC mismatch (computed 4C9FDFD5 wanted A53F6BF1) --31352-- object doesn't have a symbol table --31352-- Reading syms from /home/rom1/Documents/Programmation/C/leak (0x8048000) --31352-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000) --31352-- object doesn't have a dynamic symbol table --31352-- Reading suppressions file: /usr/lib/valgrind/default.supp --31352-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x401F000) --31352-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4021000) --31352-- Reading syms from /lib/i686/cmov/libc-2.5.so (0x403B000) --31352-- Reading debug info from /lib/i686/cmov/libc-2.5.so... --31352-- ... CRC mismatch (computed 006A30BD wanted 8B5FB05B) --31352-- object doesn't have a symbol table --31352-- REDIR: 0x40A9670 (rindex) redirected to 0x4024090 (rindex) --31352-- REDIR: 0x40A4C90 (malloc) redirected to 0x402342B (malloc) --31352-- REDIR: 0x40A64A0 (free) redirected to 0x4023045 (free) ==31352== ==31352== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1) --31352-- --31352-- supp: 13 Debian libc6 (2.5.x) stripped dynamic linker ==31352== malloc/free: in use at exit: 0 bytes in 0 blocks. ==31352== malloc/free: 1 allocs, 1 frees, 4 bytes allocated. ==31352== ==31352== All heap blocks were freed -- no leaks are possible. --31352-- memcheck: sanity checks: 0 cheap, 1 expensive --31352-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --31352-- memcheck: auxmaps: 0 searches, 0 comparisons --31352-- memcheck: SMs: n_issued = 7 (112k, 0M) --31352-- memcheck: SMs: n_deissued = 0 (0k, 0M) --31352-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M) --31352-- memcheck: SMs: max_undefined = 0 (0k, 0M) --31352-- memcheck: SMs: max_defined = 20 (320k, 0M) --31352-- memcheck: SMs: max_non_DSM = 7 (112k, 0M) --31352-- memcheck: max sec V bit nodes: 0 (0k, 0M) --31352-- memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0) --31352-- memcheck: max shadow mem size: 416k, 0M --31352-- translate: fast SP updates identified: 1,165 ( 89.2%) --31352-- translate: generic_known SP updates identified: 71 ( 5.4%) --31352-- translate: generic_unknown SP updates identified: 69 ( 5.2%) --31352-- tt/tc: 2,923 tt lookups requiring 2,938 probes --31352-- tt/tc: 2,923 fast-cache updates, 2 flushes --31352-- transtab: new 1,456 (31,623 -> 512,000; ratio 161:10) [0 scs] --31352-- transtab: dumped 0 (0 -> ??) --31352-- transtab: discarded 0 (0 -> ??) --31352-- scheduler: 25,971 jumps (bb entries). --31352-- scheduler: 0/1,536 major/minor sched events. --31352-- sanity: 1 cheap, 1 expensive checks. --31352-- exectx: 30,011 lists, 10 contexts (avg 0 per list) --31352-- exectx: 15 searches, 5 full compares (333 per 1000) --31352-- exectx: 0 cmp2, 39 cmp4, 0 cmpAll rom1@laptop ~/Documents/Programmation/C $