如何调试“调试断言失败” 在 VC++ 6

发布于 2024-07-13 09:02:17 字数 340 浏览 7 评论 0原文

我想知道如何调试以下错误:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你丑哭了我 2024-07-20 09:02:17

看起来您要么有堆损坏,要么正在对同一指针进行双重释放。 如果您闯入调试器,断言发生时调用的代码的最后一行是什么?

检查此类问题的最佳方法是使用页面堆验证程序,例如 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?

清晰传感 2024-07-20 09:02:17

点击“重试”,它将进入调试器。 这会给你调用堆栈。 从那里,您可以找到代码中有问题的部分。

提示:您可能会删除/释放某些内容两次。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文