在Windows上使用的检测释放后()。 (悬挂指针) [英] Detecting use after free() on windows. (dangling pointers)

查看:61
本文介绍了在Windows上使用的检测释放后()。 (悬挂指针)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检测程序错误后免费()使用,否则被称为悬摆指针。我知道Valgrind的可以用后免费使用的* nix的平台上的错误进行检测,但对于窗口?如果我没有来源是什么?有没有更好的方案比Valgrind的一个节目中检测所有悬摆指针?一个自由和开源将是preferred,但我会用一个商业解决方案是否会完成这项工作。

I'm trying to detect "Use after free()" bugs, otherwise known as "Dangling pointers". I know Valgrind can be used to detect "Use after free" bugs on the *nix platform, but what about windows? What if I don't have the source? Is there a better program than Valgrind for detecting all dangling pointers in a program? A free and open source would be preferred , but I'll use a commercial solution if it will get the job done.

推荐答案

MSVC的调试内存分配器已经这样做了。当你从一个指针得到0xfeeefeee提领你跷着。凭借一点运气,这将轰炸计划。

The MSVC debug memory allocator already does this. When you get 0xfeeefeee from a pointer dereference you've dangled. With some luck that will bomb the program.

这篇关于在Windows上使用的检测释放后()。 (悬挂指针)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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