Question

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

Was it helpful?

Solution

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

Heap corruption under Win32; how to locate?

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top