|
From: Maretick Scott-S. <SMA...@mo...> - 2004-07-12 17:13:43
|
So when I see this output, how can I determine where the leaks are at in the code? Obviously, there's a problem in /vob/mm2/plat/src/libMMUnsorted/api_HashTable.c on line 118? What about in the "LEAK SUMMARY" -----------------------start output----------------------------------------- ==10932== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==10932== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==10932== Using valgrind-2.0.0, a program supervision framework for x86-linux. ==10932== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==10932== ==10932== My PID = 10932, parent PID = 10877. Prog and args are: ==10932== mm_cp ==10932== ==10932== Command line: ==10932== mm_cp ==10932== Startup, with flags: ==10932== --suppressions=/apps/public/valgrind_2.0.0/lib/valgrind/default.supp ==10932== --logfile=/project/mm2dev/smareti1/valgrind_output/mm_cp.out ==10932== --leak-check=yes ==10932== -v ==10932== Reading syms from /project/mm2dev/smareti1/executables/mm_cp ==10932== Reading syms from /lib/ld-2.3.2.so ==10932== object doesn't have any debug info ==10932== Reading syms from /apps/public/valgrind_2.0.0/lib/valgrind/vgskin_memcheck.so ==10932== Reading syms from /apps/public/valgrind_2.0.0/lib/valgrind/valgrind.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libpal.so ==10932== Reading syms from /usr/lib/libbz2.so.1.0.2 ==10932== object doesn't have a symbol table ==10932== object doesn't have any debug info ==10932== Reading syms from /project/mm2dev/smareti1/executables/libpalsa.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libhapLinuxOnly.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libCMICommon.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libFwMsg.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libftb.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libpalPCDClassNames.so ==10932== Reading syms from /lib/libdl-2.3.2.so ==10932== object doesn't have any debug info ==10932== Reading syms from /lib/librt-2.3.2.so ==10932== object doesn't have any debug info ==10932== Reading syms from /project/mm2dev/smareti1/executables/libdatabaseProxy.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libpcdupdate.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libpcml.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libnemiCommon.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libnemi.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libplatformServices.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgobas.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgosrk.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgodb.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgodms.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgodpc.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libgoamsClient.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libComponentManager.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMAppServices.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMCdfIO.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMCompat.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMFSUtil.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMLogUtil.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMMutexMgr.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMPcb.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMSharedMem.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMTimers.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMUnsorted.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMGEM.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMTagTables.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMList.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMMsgConsumer.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMSCAP.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMPacketComm.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMDbCommonUtils.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMFDN.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMDataCache.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMDataStorage.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMPmPeg.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMCpGlobal.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMCP.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMScAm.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMFmIntrf.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMClCp.so ==10932== Reading syms from /project/mm2dev/smareti1/executables/libMMSS7.so ==10932== Reading syms from /usr/lib/libstdc++.so.5.0.3 ==10932== object doesn't have a symbol table ==10932== object doesn't have any debug info ==10932== Reading syms from /lib/libm-2.3.2.so ==10932== object doesn't have any debug info ==10932== Reading syms from /lib/libgcc_s-3.2.2-20030225.so.1 ==10932== object doesn't have a symbol table ==10932== object doesn't have any debug info ==10932== Reading syms from /lib/libc-2.3.2.so ==10932== object doesn't have any debug info ==10932== Reading syms from /apps/public/valgrind_2.0.0/lib/valgrind/libpthread.so ==10932== Reading suppressions file: /apps/public/valgrind_2.0.0/lib/valgrind/default.supp ==10932== Estimated CPU clock rate is 2788 MHz ==10932== REPLACING libc(__GI___errno_location) with libpthread(__errno_location) ==10932== REPLACING libc(__GI___h_errno_location) with libpthread(__h_errno_location) ==10932== REPLACING libc(__GI___res_state) with libpthread(__res_state) ==10932== ==10932== TRANSLATE: 0x40FBBBC0 redirected to 0x410E6DC8 ==10932== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==10932== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==10932== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==10932== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==10932== TRANSLATE: 0x41099D90 redirected to 0x410E6EAC ==10932== ==10932== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==10932== malloc/free: in use at exit: 213688 bytes in 21 blocks. ==10932== malloc/free: 38 allocs, 17 frees, 218027 bytes allocated. ==10932== ==10932== searching for pointers to 21 not-freed blocks. ==10932== checked 18645436 bytes. ==10932== ==10932== 404 bytes in 1 blocks are definitely lost in loss record 7 of 9 ==10932== at 0x40029886: __builtin_vec_new (vg_replace_malloc.c:203) ==10932== by 0x400298DD: operator new[](unsigned) (vg_replace_malloc.c:216) ==10932== by 0x4074A9F0: api_HashTable::api_HashTable(IDEntry&, unsigned short) (/vob/mm2/plat/src/libMMUnsorted/api_HashTable.c:118) ==10932== by 0x4074E1DF: api_Registry::api_Registry(IDEntry&, unsigned short) (/vob/mm2/plat/src/libMMUnsorted/api_Registry.c:116) ==10932== ==10932== ==10932== 200084 bytes in 1 blocks are possibly lost in loss record 9 of 9 ==10932== at 0x40029886: __builtin_vec_new (vg_replace_malloc.c:203) ==10932== by 0x400298DD: operator new[](unsigned) (vg_replace_malloc.c:216) ==10932== by 0x4074A9F0: api_HashTable::api_HashTable(IDEntry&, unsigned short) (/vob/mm2/plat/src/libMMUnsorted/api_HashTable.c:118) ==10932== by 0x4074DE40: api_Registry::api_Registry(unsigned short) (/vob/mm2/plat/src/libMMUnsorted/api_Registry.c:82) ==10932== ==10932== LEAK SUMMARY: ==10932== definitely lost: 404 bytes in 1 blocks. ==10932== possibly lost: 200084 bytes in 1 blocks. ==10932== still reachable: 13000 bytes in 18 blocks. ==10932== suppressed: 200 bytes in 1 blocks. ==10932== Reachable blocks (those to which a pointer was found) are not shown. ==10932== To see them, rerun with: --show-reachable=yes ==10932== --10932-- TT/TC: 0 tc sectors discarded. --10932-- 11108 chainings, 0 unchainings. --10932-- translate: new 26325 (347848 -> 4400729; ratio 126:10) --10932-- discard 0 (0 -> 0; ratio 0:10). --10932-- dispatch: 1000000 jumps (bb entries), of which 138554 (13%) were unchained. --10932-- 22/33393 major/minor sched events. 30269 tt_fast misses. --10932-- reg-alloc: 1143 t-req-spill, 811040+6393 orig+spill uis, 110117 total-reg-r. --10932-- sanity: 23 cheap, 1 expensive checks. --10932-- ccalls: 99454 C calls, 65% saves+restores avoided (382550 bytes) --10932-- 133946 args, avg 0.90 setup instrs each (25726 bytes) --10932-- 0% clear the stack (298362 bytes) --10932-- 27814 retvals, 33% of reg-reg movs avoided (17850 bytes) -----------------------end output------------------------------------------- |
|
From: Tom H. <th...@cy...> - 2004-07-12 17:29:31
|
In message <7FD...@az...>
Maretick Scott-SMARETI1 <SMA...@mo...> wrote:
> So when I see this output, how can I determine where the leaks are at in
> the code?
By reading the stack trace for the leak to see where the leaked
memory was allocated and then examining your code to see why it
isn't being freed again.
> Obviously, there's a problem in
> /vob/mm2/plat/src/libMMUnsorted/api_HashTable.c on line 118?
That's what it says, yes.
> What about in the "LEAK SUMMARY"
What about it? It's a sumary of the total amount of memory leaked.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-12 17:32:18
|
On Mon, 12 Jul 2004, Maretick Scott-SMARETI1 wrote: > So when I see this output, how can I determine where the leaks are at in > the code? You have to work that out for yourself... Valgrind can only tell you where the leaked blocks were allocated. N |