tags:

views:

382

answers:

4

I've been having crash problems due to heap problems, so I guess a buffer overflow is happening somewhere. How do I detect it?

+3  A: 

I use Compuware BoundsChecker as a tool for error detection in VC6. It can pick up buffer overruns.

You can also try PageHeap, a tool for windows.

Snazzer
I had some problems trying to use PageHeap, this question defines them: http://stackoverflow.com/questions/781821/debug-visual-c-memory-allocation-problems Could you provide more info on how to use it?
Rodrigo
+1  A: 

I use Rational Purify for this.

snowcrash09
+1  A: 

You can use the VC debug heap: http://msdn.microsoft.com/en-us/library/974tc9t1.aspx

Most if not all of the stuff in crtdbg.h is also supported in VC6.

Michael Burr
A: 

I got good results when simply inserting _heapchk() Windows API function on some places and hunt the error (a access to index -1 to an array in my case).

rstevens