Debug assertion failure

K

Kostatus

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?
 
G

Gianni Mariani

Kostatus said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top