[windev] Buffer and handle checking in C++ 2008
Chris Becke
Chris.Becke at derivco.com
Mon Nov 2 07:34:11 GMT 2009
BoundsChecker now comes with a complicated licencing scheme that means, more often than not, the BC tools don't show up in your dev environment.
When it does work, its slow, and crashes a lot. Weve had to re-write code to work around the fact that BC intercepts some standard interfaces with a hook interface thats too small and hence GPs in metriced builds.
There is a vast amount of debugging stuff built right into the OS. Get and use AppVerifier - it can detect memory overruns by putting the app heap into a mode where the end of each allocation is padded with unallocated memory. In conjunction with WinDbg, it can also set the heap into a mode where stack traces are saved for each memory allocation. Using these features have a steeper learning curve than usinc BC, but the dirty secret is, once you have the hang of them they leave the easier tools like BC in the dust.
Layered on top of that, the C-runtime also has a number of features built into the debugging heap. _CrtDumpMemoryLeaks is a simple function that dumps unallocated blocks to the debug output. Doing something as simple as overriding new & malloc and x-reffing block sizes with the leak report you can easily set smart breakpoints that stop right where a leaked allocation is occurring.
Once you've weaned yourself off of boundschecker, try the profiling features built into Visual Studio. As of VS 2008 the UI challenges the equivalent Compuware DevPartner tool, but with a far lower negative overhead on application performance while collecting data.
________________________________________
From: windev-bounces at windev.org [windev-bounces at windev.org] On Behalf Of Andy Faulkner [Andy.Faulkner at lcp.uk.com]
Sent: 29 October 2009 12:18 PM
To: windev at windev.org
Subject: [windev] Buffer and handle checking in C++ 2008
Hi,
Does anyone know of any good memory/pointer/handle checking software for
C and C++ using Visual Studio 2008. We currently use BoundsChecker in
Visual C++ 6.0, but cant justify the purchase for 2008 due to the price
and our low usage.
I've looked at MemDebug which does a lot of what I need, but it's C++
only and we need C also.
Thanks,
Andy.
--
Windev mailing list at Windev at windev.org
Lost your password? Need to unsubscribe or change your delivery options?
Go to http://lists.windev.org/mailman/listinfo/windev
--
Search the Windev Archives - www.windev.org
#############################################################################################
The information transmitted is intended only for the person or entity to which it
is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact the sender and
delete the material from any computer.
Furthermore, the information contained in this message, and any attachments thereto, is
for information purposes only and may contain the personal views and opinions of the
author, which are not necessarily the views and opinions of the company.
#############################################################################################
More information about the Windev
mailing list