- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在处理以下访问冲突:
Unhandled exception at 0x77DB2A10 (ntdll.dll) in <Process>.exe.dmp:
0xC0000005: Access violation reading location 0x184487B8. occurred
源代码如下:
Result CParameter::SetValue(..., ..., <internal_Class>* pBlock, ...)
{
...
<internal_Class>* pStore = nullptr;
if (!pBlock)
{
pStore = &m_Data; // m_Data is a global variable
}
else pStore = pBlock;
if (pStore->pbData)
{
pStore->Clear(); // here we have the crash
}
调用堆栈如下所示:
ntdll.dll!_RtlpCoalesceFreeBlocks@16() Unknown Non-user code. Symbols loaded.
ntdll.dll!@RtlpFreeHeap@16() Unknown Non-user code. Symbols loaded.
ntdll.dll!_RtlFreeHeap@12() Unknown Non-user code. Symbols loaded.
ole32.dll!CRetailMalloc_Free(IMalloc * pThis=0x777476bc, void * pv=0x1842de40) Line 687 C++ Non-user code. Symbols loaded.
ole32.dll!CoTaskMemFree(void * pv=0x1842de40) Line 475 C++ Non-user code. Symbols loaded.
=> <Process>.exe!CParameter::SetValue(..., <internal_Class> * pBlock=0x00000000, ...) Line 5528 C++ Symbols loaded.
在监 Windows 口中,我看到 &m_Data 的以下值:
0x77e4f9ae {Inside ntdll.dll!_RtlpAnalyzeHeapFailure@12()} {pbData=0xd2b70f3d <Error reading characters of string.> ...}
更多信息:
pBlock
的值为 NULL
pStore
的值问题:
提前致谢
最佳答案
Where is the function "Clear()" in the call stack?
这看起来像是内联的。
The value of pStore is unknown by the debugger
这不是还是m_Data吗?
如果你查看崩溃点附近的代码,你可以看到它最近在哪个寄存器中,如果它被保留,那么你应该能够看到它在某个时刻被保存。
该错误是由于内存系统检测到内存被错误释放所致。这可能是因为 m_Data 持有 float 值,或者已经被删除。
我已经制作了类似的功能。
__declspec(noinline) void Type::Clear()
{
delete pbData;
pbData = nullptr;
}
__declspec(noinline) void SetValue(Type * pBlock)
{
Type * pStore = nullptr;
if (!pBlock)
{
pStore = &m_Data; // m_Data is a global variable
}
else pStore = pBlock;
if (pStore->pbData)
{
pStore->Clear(); // here we have the crash
}
}
它的反汇编(来自windbg)是:-
0:000:x86> uf debugging2!SetValue
debugging2!Type::Clear [c:\source\example\debugging2\debugging2.cpp @ 17]:
17 01041020 56 push esi
17 01041021 8bf1 mov esi,ecx
18 01041023 6a00 push 0
18 01041025 ff36 push dword ptr [esi]
18 01041027 e85c000000 call debugging2!operator delete (01041088)
18 0104102c 83c408 add esp,8
19 0104102f c70600000000 mov dword ptr [esi],0
19 01041035 5e pop esi
20 01041036 c3 ret
debugging2!SetValue [c:\source\example\debugging2\debugging2.cpp @ 23]:
23 01041040 833df833040100 cmp dword ptr [debugging2!m_Data (010433f8)],0
31 01041047 740a je debugging2!SetValue+0x13 (01041053)
Branch
debugging2!SetValue+0x9 [c:\source\example\debugging2\debugging2.cpp @ 33]:
33 01041049 b9f8330401 mov ecx,offset debugging2!m_Data (010433f8)
33 0104104e e9cdffffff jmp debugging2!Type::Clear (01041020) Branch
debugging2!SetValue+0x13 [c:\source\example\debugging2\debugging2.cpp @ 35]:
35 01041053 c3 ret Branch
这表明(在我的例子中)对 Clear() 的调用已被跳转所取代,通过优化将其从堆栈中隐藏起来。这也表明在地址 01041049
ecx 中加载了调用的值。 MSDN : x86 calling conventionsECX 不是保留值,因此我们无法找到它所保存的值(除了您评论中的 &m_Data 之外)。
但是我们可以查看堆栈上的函数...
在::Clear 函数中,ecx 被移至 esi。因此 esi(被保留)现在具有相同的值。
查看下一个函数(运算符删除),
debugging2!operator delete
[f:\dd\vctools\crt\vcstartup\src\heap\delete_scalar_size.cpp @ 14]:
14 01041088 55 push ebp
14 01041089 8bec mov ebp,esp
15 0104108b ff7508 push dword ptr [ebp+8]
15 0104108e e890030000 call debugging2!operator delete (01041423)
15 01041093 59 pop ecx
16 01041094 5d pop ebp
16 01041095 c3 ret
我们看到esi没有改变,也没有保存。所以我们看看堆栈上的下一个函数......
0:000:x86> uf 01041423
Flow analysis was incomplete, some code may be missing
debugging2!operator delete
[f:\dd\vctools\crt\vcstartup\src\heap\delete_scalar.cpp @ 15]:
15 01041423 e982090000 jmp debugging2!free (01041daa) Branch
在每种情况下,我们都在寻找存储在堆栈上某处的 esi,这样我们就可以找到它......
关于c++ - 转储监 Windows 口中 "RtlpAnalyzeHeapFailure"的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46911731/
这个问题在这里已经有了答案: Towards the "true" definition of JAVA_HOME (5 个答案) 关闭 4 年前。 为什么 ActiveMQ 提供者需要设置 JAV
这个问题在这里已经有了答案: What is a lambda expression in C++11? (10 个答案) 关闭 8 年前。 这是来自 boosts asio 的一个例子。这是什么意
这个问题在这里已经有了答案: What does the double colon (::) mean in CSS? (3 个答案) 关闭 7 年前。 我经常看到这种用法。特别是伪类。“::”在
嗨,另一个愚蠢的简单问题。我注意到在Apple框架中的某些typedef中使用符号"<<"谁能告诉我这是什么意思?: enum { UIViewAutoresizingNone
someObject.$() 是什么意思? 我正在浏览 sapui5 工具包中的 tilecontainer-dbg 文件,发现了这个: var oDomRef = this.$(); or some
这个问题已经有答案了: How to interpret function parameters in software and language documentation? (4 个回答) 已关闭
我遇到过这个语法。任何人都可以解释一下 getArg1ListInfo:()=>(object.freeze(arg1)) 的含义 function foo (arg1,arg2) { let
对于子类,我有以下代码: class child1 : public parent { public: static parent* function1(void) { ret
这个问题在这里已经有了答案: What does "|=" mean? (pipe equal operator) (6 个答案) 关闭 1 年前。 我有一部分代码包含以下功能: void Keyb
以下在 C++ 中是什么意思? typedef PComplex RComplex [100]; 请注意,PComplex 是我代码中的用户定义类型。 谢谢 最佳答案 RComplex 是 PComp
在我的 Lisp 代码中,我有函数 (nfa-regex-compile),它创建一个包含初始状态、转换和最终状态的 cons 列表(表示自动机的节点)从作为参数给出的正则表达式开始。 在这种情况下,
以下文字摘自 Learning Spark 第 3 章 One issue to watch out for when passing functions is inadvertently seria
PHP 文档 block 中以下内容的含义是什么: #@+ zend框架代码中的一个例子: /**#@+ * @const string Version constant numbers */ c
由于 python 的一些版本控制问题,我必须使用自定义函数来比较 HMAC (SHA512)。为此,我找到了这个函数: def compare_digest(x, y): if not (i
取自this answer here : static const qi::rule node = '{' >> *node >> '}' | +~qi::char_("{}"); 请注意,声明了名称
我正在查看 chi 包的文档。我看到类似的东西: https://github.com/pressly/chi/blob/master/_examples/rest/main.go#L154 data
我想知道如果我采用值为 8 的 INT,这是否意味着我只能从 1 到 99999999 或从 1 到 4294967295 UNSIGNED? 最佳答案 文档似乎很清楚这一点: Numeric Typ
我想知道如果我采用值为 8 的 INT,这是否意味着我只能从 1 到 99999999 或从 1 到 4294967295 UNSIGNED? 最佳答案 文档似乎很清楚这一点: Numeric Typ
这个问题在这里已经有了答案: 关闭9年前。 Possible Duplicate: Does “/* (non-javadoc)” have a well-understood meaning? 以下
在 Prolog 代码中,可以使用“ headless ”Horn 子句将指令传递给编译器,这些子句与指向左侧的物质蕴涵 ':-' (⇐) 的左侧没有头部关系。例如,导入模块或声明 Unit Test
我是一名优秀的程序员,十分优秀!