July 19th, 2002, 10:27 AM
Debug Assertion Failed!
I get a Debug Assertion Failed error message (_CrtCheckMemory) when I run my code. Anywhere I use a "new" statement is succeptible to this error. It doesn't happen every time certain code is executed but I can reproduce the error when certain code is run more than once. Someone told me I could be running out of heap space but I find that hard to believe. I am having hard time debugging because I think the errors are appearing at places which are the symptom of the problem, not the cause. Anyone have any ideas where I should look to try and track this down?
July 10th, 2003, 09:02 PM
Your heap may be getting corrupted in another part of your code, and the internal checks inside new may be noticing this and asserting false. There are several ways this can happen, but it is often because you're freeing memory that's already been freed.
Running your code with a utility like Rational Purify may help identify where the invalid memory usage is occurring. If you don't have access to Purify, you might look for similar tools that are available on the web.