|
From: Darren C. <da...@dc...> - 2004-01-26 06:45:18
|
Hi, I just installed valgrind from source, default configuration, and tried it on a C++ program with a memory leak I'd inserted, specifically I added this line, with no delete: char *myleak=new char[777];myleak[0]='x';myleak[1]=0; //TEMP! But it says no errors [1]; it also says no malloc'd blocks. (my program doesn't spawn children but I added that line just to be sure after reading the FAQ). I'm compiling with -g3, no optimizations, using g++ 3.2 on RH8. Is this a bug or do I need to add some command-line option to get it to work with C++ programs? Darren [1]: $ valgrind -v --leak-check=yes --trace-children=yes ./9.apd_1.exe ==14950== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==14950== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==14950== Using valgrind-2.0.0, a program supervision framework for x86-linux. ==14950== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==14950== Command line: ==14950== ./9.apd_1.exe ==14950== Startup, with flags: ==14950== --suppressions=/usr/local/lib/valgrind/default.supp ==14950== -v ==14950== --leak-check=yes ==14950== --trace-children=yes ==14950== Reading syms from /home/darren/Projects/ago3/tests/9.apd_1.exe ==14950== Reading syms from /lib/ld-2.3.2.so ==14950== object doesn't have a symbol table ==14950== object doesn't have any debug info ==14950== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so ==14950== Reading syms from /usr/local/lib/valgrind/valgrind.so ==14950== Reading syms from /usr/lib/libstdc++.so.5.0.1 ==14950== Reading syms from /lib/i686/libm-2.3.2.so ==14950== object doesn't have a symbol table ==14950== object doesn't have any debug info ==14950== Reading syms from /lib/libgcc_s-3.2-20020903.so.1 ==14950== Reading syms from /lib/i686/libc-2.3.2.so ==14950== object doesn't have a symbol table ==14950== object doesn't have any debug info ==14950== Reading suppressions file: /usr/local/lib/valgrind/default.supp ==14950== Estimated CPU clock rate is 2007 MHz ==14950== ==14950== ==14950== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==14950== malloc/free: in use at exit: 0 bytes in 0 blocks. ==14950== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==14950== ==14950== No malloc'd blocks -- no leaks are possible. --14950-- TT/TC: 0 tc sectors discarded. --14950-- 2788 chainings, 0 unchainings. --14950-- translate: new 4041 (64557 -> 848058; ratio 131:10) --14950-- discard 0 (0 -> 0; ratio 0:10). --14950-- dispatch: 5050000 jumps (bb entries), of which 339308 (6%) were unchained. --14950-- 103/5057 major/minor sched events. 4104 tt_fast misses. --14950-- reg-alloc: 508 t-req-spill, 158757+3291 orig+spill uis, 19742 total-reg-r. --14950-- sanity: 104 cheap, 5 expensive checks. --14950-- ccalls: 18348 C calls, 57% saves+restores avoided (61672 bytes) --14950-- 24848 args, avg 0.88 setup instrs each (5570 bytes) --14950-- 0% clear the stack (55044 bytes) --14950-- 5370 retvals, 33% of reg-reg movs avoided (3462 bytes) |