|
From: nitin s. <xml...@ya...> - 2004-11-28 20:16:55
|
Hello, I am using valgrind to report memory leaks in one of my programs. I get the following error ==1203== ==1203== ERROR SUMMARY: 19904 errors from 58 contexts (suppressed: 35 from 1) ==1203== malloc/free: in use at exit: 6833 bytes in 137 blocks. ==1203== malloc/free: 5694 allocs, 5557 frees, 331615 bytes allocated. ==1203== For counts of detected errors, rerun with: -v ==1203== searching for pointers to 137 not-freed blocks. ==1203== checked 6131788 bytes. ==1203== ==1203== ==1203== 84 bytes in 1 blocks are definitely lost in loss record 2 of 7 ==1203== at 0x1B903D1C: malloc (vg_replace_malloc.c:131) ==1203== by 0x806D10D: default_malloc_ex (in /home/xml/testdecrypt2) ==1203== ==1203== LEAK SUMMARY: ==1203== definitely lost: 84 bytes in 1 blocks. ==1203== possibly lost: 0 bytes in 0 blocks. ==1203== still reachable: 6549 bytes in 135 blocks. ==1203== suppressed: 200 bytes in 1 blocks. ==1203== Reachable blocks (those to which a pointer was found) are not shown. ==1203== To see them, rerun with: --show-reachable=yes I cannot get the memory leak report to be more verbose. It tells the starting point in executable i.e. ---------------------- by 0x806D10D: default_malloc_ex (in /home/xml/testdecrypt2) ------------------------- But I want that to be in my C code. In testdecrypt.c I dont have any malloc calls, thus malloc call is in some library. The whole stack report, i.e. the exact place and file where the malloc is issued is also missing. I tried --num-callers=50 but doesnt work. Can somebody please tell me how to find this leak. thanks Nitin. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Robert W. <rj...@du...> - 2004-11-28 20:59:29
|
> I cannot get the memory leak report to be more verbose. > It tells the starting point in executable i.e. > ---------------------- > by 0x806D10D: default_malloc_ex (in > /home/xml/testdecrypt2) > ------------------------- > But I want that to be in my C code. In testdecrypt.c I dont > have any malloc calls, thus malloc call is in some library. > The whole stack report, i.e. the exact place and file > where the malloc is issued is also missing. >=20 > I tried --num-callers=3D50 but doesnt work. > Can somebody please tell me how to find this leak. > thanks Is your code compiled with -g and with no -O option? It looks like Valgrind just doesn't have the info it needs to get more verbose, suggesting you're compiling with -O. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: nitin s. <xml...@ya...> - 2004-11-28 21:46:17
|
Hello, Thanks for your prompt reply. I do take care of compling my code with -g option. I am not using -O. the options I have tried with valgrind are --tool=addrcheck --leak-check=yes --num-callers=50 But it just does'nt tell me what is happening. I checked my code so many times, but am not able to catch the leak manually. Thanks Nitin --- Robert Walsh <rj...@du...> wrote: > > I cannot get the memory leak report to be more > verbose. > > It tells the starting point in executable i.e. > > ---------------------- > > by 0x806D10D: default_malloc_ex (in > > /home/xml/testdecrypt2) > > ------------------------- > > But I want that to be in my C code. In > testdecrypt.c I dont > > have any malloc calls, thus malloc call is in some > library. > > The whole stack report, i.e. the exact place and > file > > where the malloc is issued is also missing. > > > > I tried --num-callers=50 but doesnt work. > > Can somebody please tell me how to find this leak. > > thanks > > Is your code compiled with -g and with no -O option? > It looks like > Valgrind just doesn't have the info it needs to get > more verbose, > suggesting you're compiling with -O. > > Regards, > Robert. > > -- > Robert Walsh > Amalgamated Durables, Inc. - "We don't make the > things you buy." > Email: rj...@du... > > ATTACHMENT part 2 application/pgp-signature name=signature.asc __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com |
|
From: Robert W. <rj...@du...> - 2004-11-29 01:22:47
|
> Thanks for your prompt reply. I do take care of=20 > compling my code with -g option. I am not using -O. > the options I have tried with valgrind are > --tool=3Daddrcheck --leak-check=3Dyes --num-callers=3D50 >=20 > But it just does'nt tell me what is happening. I checked > my code so many times, but am not able to catch the=20 > leak manually. The only other thing I can think of is that there's a macro you're using in testdecrypt.c that's calling malloc(). Or a piece of code inlined in a header file somewhere. Other than that, I'm lost. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: nitin s. <xml...@ya...> - 2004-11-29 16:59:37
|
Hey, You just gave me enough hint. The macro was in openssl, not in my code. I had to call the free function for that structure. I have removed the leak now. :-) thanks Nitin. Robert Walsh <rj...@du...> wrote: > Thanks for your prompt reply. I do take care of > compling my code with -g option. I am not using -O. > the options I have tried with valgrind are > --tool=addrcheck --leak-check=yes --num-callers=50 > > But it just does'nt tell me what is happening. I checked > my code so many times, but am not able to catch the > leak manually. The only other thing I can think of is that there's a macro you're using in testdecrypt.c that's calling malloc(). Or a piece of code inlined in a header file somewhere. Other than that, I'm lost. Regards, Robert. -- Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... > ATTACHMENT part 2 application/pgp-signature name=signature.asc --------------------------------- Do you Yahoo!? The all-new My Yahoo! Get yours free! |
|
From: Josef W. <Jos...@gm...> - 2004-11-29 17:26:51
|
On Sunday 28 November 2004 22:46, nitin singh wrote: > But it just does'nt tell me what is happening. I > checked > my code so many times, but am not able to catch the > leak manually. You could try out callgrind, and look at the callgraph leading to default_malloc_ex. Callgrind does not look at stack frames, but looks (among more tricky things) at executed CALL and RET instructions itself to build up its view of the callgraph while the program is running. Josef > Thanks > Nitin > > --- Robert Walsh <rj...@du...> wrote: > > > I cannot get the memory leak report to be more > > > > verbose. > > > > > It tells the starting point in executable i.e. > > > ---------------------- > > > by 0x806D10D: default_malloc_ex (in > > > /home/xml/testdecrypt2) > > > ------------------------- > > > But I want that to be in my C code. In > > > > testdecrypt.c I dont > > > > > have any malloc calls, thus malloc call is in some > > > > library. > > > > > The whole stack report, i.e. the exact place and > > > > file > > > > > where the malloc is issued is also missing. > > > > > > I tried --num-callers=50 but doesnt work. > > > Can somebody please tell me how to find this leak. > > > thanks > > > > Is your code compiled with -g and with no -O option? > > It looks like > > Valgrind just doesn't have the info it needs to get > > more verbose, > > suggesting you're compiling with -O. > > > > Regards, > > Robert. > > > > -- > > Robert Walsh > > Amalgamated Durables, Inc. - "We don't make the > > things you buy." > > Email: rj...@du... > > > > > > ATTACHMENT part 2 application/pgp-signature > > name=signature.asc > > > > > > __________________________________ > Do you Yahoo!? > The all-new My Yahoo! - Get yours free! > http://my.yahoo.com > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |