03-14-2012, 06:10 PM
Are you using MS Application Verifier? That's a really useful thing, too. It can enable loads of debugging features built into Windows, one of them being guard pages around heap allocations. It might help you pinpoint the issues in your app.
Otherwise there's not much that can be said in general, most of the times you'll be hunting a specific issue and there is no generic recipe for that.
You should be using the stack window, the watches, memory window etc. Also with App verifier, it outputs its debugging info into the Output window, that comes in handy as well. When judging multithreaded code, remember to ask yourself, upon each line, "is there any way this could be accessed by another thread simultaneously? Will it cause problems if another thread modified this under my hands?" Forgetting to lock things using critical sections is one of the most common source of heap problems in multithreaded programs.
Otherwise there's not much that can be said in general, most of the times you'll be hunting a specific issue and there is no generic recipe for that.
You should be using the stack window, the watches, memory window etc. Also with App verifier, it outputs its debugging info into the Output window, that comes in handy as well. When judging multithreaded code, remember to ask yourself, upon each line, "is there any way this could be accessed by another thread simultaneously? Will it cause problems if another thread modified this under my hands?" Forgetting to lock things using critical sections is one of the most common source of heap problems in multithreaded programs.