2

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

Rodrigo
  • 5,938
  • 6
  • 31
  • 39

4 Answers4

3

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
  • 7,704
  • 5
  • 27
  • 25
  • 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 Apr 23 '09 at 20:18
1

I use Rational Purify for this.

snowcrash09
  • 4,694
  • 27
  • 45
1

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
  • 333,147
  • 50
  • 533
  • 760
0

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).

mmmmmmmm
  • 15,269
  • 2
  • 30
  • 55