Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, July 2007
Detect memory leak and corruption on Qt

Pages: Prev | 1 | 2 | Next

Message 16 in thread

Thanks for running the test in Valgrind.

I don't agree that you should not care about deallocating memory when
you are about to exit anyways though.

It's like not caring about compiler warnings,
difficult to detect real problems when they arise then.

The Valgrind docs describe it as "programming sloppiness":
> Still reachable: A pointer to the start of the block is found. 
  This usually indicates programming sloppiness. Since the block is
still pointed at,
  the programmer could, at least in principle, free it before program exit.

It would be really nice if this memory could, at least optionally, be
cleaned up when the Application object is destroyed.

- DavidF

Esben Mose Hansen wrote:
> On Saturday 07 July 2007 20:01:03 David Forstenlechner wrote:
>> I tried both, boost unit test and Boundschecker and get 7 memory
>> leaks reported with a single line test program like
>>
>> main(int argc, char* argv[])
>> {
>>     QCoreApplication app(argc, argv);
>> }
>>
> 
> Valgrind (from linux) reports that test as clean. 
> 
> ==1687== LEAK SUMMARY:
> ==1687==    definitely lost: 0 bytes in 0 blocks.
> ==1687==      possibly lost: 0 bytes in 0 blocks.
> ==1687==    still reachable: 11,085 bytes in 143 blocks.
> ==1687==         suppressed: 0 bytes in 0 blocks.
> 
> Are you sure that Boundschecker doesn't (errornously) report reachable blocks 
> as leaks? There is little point in deallocating memory if you are about to 
> call exit() anyway :)
> 

--
 [ signature omitted ] 

Message 17 in thread

Thank you for everyone

I checked and tested comercial tools. 

http://www.automatedqa.com/
http://www.compuware.com/products/devpartner/studio.htm
http://www.glowcode.com/summary1_gc.htm
http://www.parasoft.com/jsp/products/home.jsp?product=CppTest
http://www.deleaker.com/
http://valgrind.org/
http://dmoulding.googlepages.com/
http://www.softwareverify.com/productsCpp.html
http://www.microsoft.com/technet/prodtechnol/windows/appcompatibility/appverifier.mspx

But there are no tools to run on WindowsXP 64 bit edition.
Do you know other tools to detect memory leak and corruption?

===================================
Masatoshi Sasai

--
 [ signature omitted ]