用户断点从无处 [英] User Breakpoint from nowhere

查看:125
本文介绍了用户断点从无处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MS VC ++ 6.0中有一些代码,我正在调试。由于某种原因,在这个点我试图删除一些动态分配的内存,它打破了,我得到一个弹出消息框,说用户断点从代码blah blah调用,然后反汇编窗口弹出和我请参阅

I have some code in MS VC++ 6.0 that I am debugging. For some reason, at this certain point where I am trying to delete some dynamically allocated memory, it breaks and I get a pop up message box saying "User Breakpoint called from code at blah blah".. then the Disassembly window pops up and I see

*memory address* int      3

$奇怪的是,在代码中有NOWHERE,我正在调用这样的汇编指令(我认为asm int 3是x86的硬件断点命令。)..

The odd thing is, there is NOWHERE in the code that I am calling an assembly instruction like this (I think asm int 3 is a hardware break command for x86?)..

这可能是什么原因造成的?

what could be causing this?

编辑:ANSWER:我的代码是但只有在Visual Studio标记的位置调试与0xFDFDFDFD,这被称为NoMan'sLand栅栏..我认为它也称为一个一一错误..这个数组与我释放内存的点无关当错误发生时。这使得难以发现..:(

ANSWER: My code was "walking off the end" of an array, but only in the locations marked by Visual Studio debug with 0xFDFDFDFD, which is called a NoMan'sLand fence.. I think its also called an Off-by-one error.. This array was unrelated to the point where i was freeing the memory when the error was occuring. Which made it harder to spot.. :(

推荐答案

你可能在调试堆例程中找到堆

You're probably hitting code in the debug heap routines that have found heap corruption.

编辑:

根据你的注释中的堆栈跟踪,例程 _CrtIsValidHeapPointer()表示被释放的指针是坏的。这是MSVC的DBGHEAP.C代码片段: / p>

Based on the stack trace in your comments, the routine _CrtIsValidHeapPointer() is saying that the pointer being freed is bad. Here's the snippet of code from MSVC's DBGHEAP.C source:

    /*
     * If this ASSERT fails, a bad pointer has been passed in. It may be
     * totally bogus, or it may have been allocated from another heap.
     * The pointer MUST come from the 'local' heap.
     */
    _ASSERTE(_CrtIsValidHeapPointer(pUserData));

pUserData 重新删除。

这篇关于用户断点从无处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆