简体   繁体   English

VC ++ 6.0-WinDbg堆栈跟踪显示了malloc的崩溃点

[英]VC++ 6.0 - WinDbg stack trace shows a crash point at malloc

The stack trace in windbg after application crash is as below: 应用程序崩溃后,windbg中的堆栈跟踪如下:

ntdll+0x11766
msvcrt!free+0x1ae
msvcrt!free+0x1cc
msvcrt!malloc+0x27
mfc42!Ordinal823+0x2f

Please let me know what is this Ordinal means and why free is invoked twice? 请让我知道这是什么序数方式,为什么免费两次被调用?

When the crash is inside malloc or free, the cause is most likely heap corruption. 当崩溃发生在malloc或free内部时,原因很可能是堆损坏。 The cause for corruption may have happened in code not related to the current stack. 损坏的原因可能发生在与当前堆栈无关的代码中。 To verify if the heap is corrupted, use 要验证堆是否已损坏,请使用

!heap –s –v

You will need symbols for this, in advance use 为此,您需要预先使用符号

.symfix

You are probably not in free at all, due to lack of symbols the stack is displayed with offset to the nearest exports, hence the big offset (free+0x1cc ) Inspect the stack after the .symfix and enjoy ! 由于缺少符号,您可能根本没空,堆栈显示时偏移到最近的出口,因此偏移量很大(free + 0x1cc)在.symfix之后检查堆栈,然后享受!

To find the root cause for memory corruption different approaches can be used, but if possible full page heap is a good one. 为了找到导致内存损坏的根本原因,可以使用不同的方法,但是如果可能的话,使用整页堆是一种很好的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM