使用Windows Debug 工具来侦测堆崩溃

 

程序遇到运行时异常

Windows has triggered a breakpoint in MainD.exe. This may be due to a corruption of the heap, and indicates a bug in Agistment Utility.exe or any of the DLLs it has loaded. The output window may have more diagnostic information...

HEAP[MainD.exe]: HEAP: Free Heap block 15f05f8 modified at 15f0640 after it was freed


使用BoundsCheck 查不出任何问题,可能原因是:
1. 访问已经被释放的内存
2. 再次释放已经被释放过的内存

对于第2点,因为我自己使用SAFE_DELETE,基本不可能,google了很久,终于找到了一个MSMVP的建议.

下载Windows Debug 工具,
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
安装后,使用其中的gflags.exe工具打开PageHeap,
gflags -p /enable MainD.exe /full
重新使用VS用调试方式运行,很快就找到了出错位置,因为在某个静态函数中笔误导致

在编写稳定的服务器程序时,这个工具尤为有用
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值