By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Debug assertion failure

P: n/a
When I close my program and call:
delete *iter2;
(iter2 being an iterator of a vector which contains pointers to objects)
I get a "Debug Assertion Failed!" message (using VC++ 6) with the following
details:
File: dbgheap.c
Line: 1017
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
What does this mean?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Kostatus wrote:
When I close my program and call:
delete *iter2;
(iter2 being an iterator of a vector which contains pointers to objects)
I get a "Debug Assertion Failed!" message (using VC++ 6) with the following
details:
File: dbgheap.c
Line: 1017
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
What does this mean?


It means that data structures used to manage the heap have been
corrupted by your program.

<the rest is off topic for this ng>

This is usually caused by writing off the end of an array.

These bugs are usually very difficult to find. First an most obvious
place to look is a few lines before the crash but the corruption could
have been caused by virtually anything - even reading from a file.

If it is really this difficult you'll need to use a malloc debugging
tool of some kind. I use valgrind and efence on Linux. You could use
purify on Windows but I have have zero success personally with purify on
windows - most probably I don't know how to use it correctly.

Good luck.

G

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.