views:

560

answers:

2

I wonder how to debug the following error:

Debug Assertion failure

Program: tomtoprog.exe
File: dbgheap.c
Line: 1044

Expression:_CrtIsValidHeapPointer(pUserData)
...

I'm quiet new to windows development with VC++ 6 ... is there a valgrind or something like that? The tomtoprog code is not written by me and its rather messy ... so something like valgrind would make my life way easier ...

Thanks in advance!

Best regards,

Zhengtonic

+1  A: 

Hit 'Retry', and it'll break into the debugger. That'll give you the call stack. From there, you can find the part of your code that's at fault.

Hint: you're probably delete/free-ing something twice.

Roger Lipscombe
+2  A: 

It looks like you either have heap corruption or you are doing a double free of the same pointer. If you break into the debugger what is the last line of your code that is being called when the assert occurs?

The best way to check for issues like this is to use a page heap verifier like PageHeap.exe

Also see this related question on stack overflow

http://stackoverflow.com/questions/1069/heap-corruption-under-win32-how-to-locate

JaredPar