如何调试“调试断言失败” 在 VC++ 6
我想知道如何调试以下错误:
Debug Assertion failure
Program: tomtoprog.exe
File: dbgheap.c
Line: 1044
Expression:_CrtIsValidHeapPointer(pUserData)
...
我对使用 VC++ 6 进行 Windows 开发很陌生...是否有 valgrind 或类似的东西? tomtoprog 代码不是我写的,它相当混乱......所以像 valgrind 这样的东西会让我的生活变得更轻松......
提前致谢!
最好的问候,
正通
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您要么有堆损坏,要么正在对同一指针进行双重释放。 如果您闯入调试器,断言发生时调用的代码的最后一行是什么?
检查此类问题的最佳方法是使用页面堆验证程序,例如 PageHeap.exe
另请参阅有关堆栈溢出的相关问题
Win32 下的堆损坏; 如何定位?
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?
点击“重试”,它将进入调试器。 这会给你调用堆栈。 从那里,您可以找到代码中有问题的部分。
提示:您可能会删除/释放某些内容两次。
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.