检测泄漏内存和缓冲区溢出问题的工具 [英] Tools to detect leak memory and buffer overflow problem

查看:169
本文介绍了检测泄漏内存和缓冲区溢出问题的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些解决方案来解决内存泄漏(或缓冲区溢出问题).

例如:某些工具可以在大型程序(例如,具有一百万个代码行)中自动检测缓冲区溢出问题"

有什么工具可以检测到泄漏吗?

真诚地感谢您的帮助.

I need some solutions to solve the leaking memory (or buffer overflow problem).

For examples: some tools can automatically detect "buffer overflow problem" in a big program (e.g. with a million code line)

Is there any tools can detect that leak?

Any helps will be sincerely appreciated.

推荐答案

众所周知,如果不进行真正的全面测试,就很难修复和检测非托管语言和平台中的内存泄漏.好机会,你会错过一些.

话虽如此,请查看以下链接:
Visual Leak Detector-增强的Visual C ++内存泄漏检测 [ http://www.linuxjournal.com/article/6556 [ http://www.softwareverify.com/cpp-memory.php [ http://www.cplusplus.com/forum/general/2335/ [
Memory leaks in non-managed languages and platforms are notoriously hard to fix and detect without really thorough testing and even then there is a good chance you will miss some.

Having said that check out the following links :
Visual Leak Detector - Enhanced Memory Leak Detection for Visual C++[^]

http://www.linuxjournal.com/article/6556[^]

http://www.softwareverify.com/cpp-memory.php[^]

http://www.cplusplus.com/forum/general/2335/[^]


即使Mehdi指的是一个泄漏检测问题同样困难,实际上是最容易检测到的内存问题.大多数复杂性与不同的API和平台以及在C ++开发过程中占主导地位的不同内存模型的混合有关.所有这些蠕虫病毒仍然存在于Windows API中.

在理想情况下,问题非常简单:存在一些内存分配API.检测器连接API,监视所有分配和释放,并计算每个对象的详细余额,基本上就是这个.在许多环境中,这是100%可靠的.在现实生活中,主要问题是使用混合API,但是泄漏检测器仍然可以找出所有泄漏情况.

我还建议您查看Visual Leak Detector.
Memory Debugger (内存调试器)是更通用的内存工具类,请参见
http://en.wikipedia.org/Wiki/Memory_debugger [ ^ ].内存调试器还可以解决那些缓冲区溢出问题.请参阅上面引用的文章中的内存工具列表.

与内存泄漏相比,缓冲区溢出缓冲区溢出问题更加困难,至少对于C ++处理指针和数组的不安全方式而言更是如此.请参阅以获取更多信息以及用于解决该问题的技术: http://en.wikipedia.org/wiki/Buffer_overflow [^ ].

我个人并不熟悉有效地帮助克服C ++缓冲区溢出问题的工具.同样,请查看内存调试器"上的文章中的工具列表.

—SA
Even though Mehdi refers to a problem of leak detection as difficult, it is actually the easiest of the memory problems to detect. Most complications are related to the mix of different APIs and platforms, different memory models which dominated during the development of C++. All this can of worms still lives in the Windows API.

In the ideal situation, the problem is pretty simple: there is some memory allocation API. A detector hooks up the API, monitors all allocations and deallocations and calculates detailed balance for each object, that''s basically it. In many environments, this is 100% reliable. In real life, the main problem is using mixed APIs, but still a leak detectors dig out all the leaky situations.

I would also recommend to look at Visual Leak Detector.
Somewhat more general class of memory tools is the Memory Debugger, see http://en.wikipedia.org/wiki/Memory_debugger[^]. The Memory Debuggers can also address those buffer overrun problems. Please see the memory tools list in the article referenced above.

In contrast to memory leaks, buffer overflow or buffer overrun problems are more difficult, at least with the unsafe way C++ works with pointers and arrays. Please see for more information and the techniques used to overcome the problem: http://en.wikipedia.org/wiki/Buffer_overflow[^].

I''m not personally familiar with the tools effectively helping to overcome the problems of buffer overflow with C++. Again, please look at the list of tools from the article on Memory Debuggers.

—SA


我不知道任何有用的免费或共享软件工具,尤其是那些超出内存泄漏检测范围的工具.但是,有一些商业产品,价格在4-5位之间.而且,IME,您可能想要拥有或购买一台额外的机器来运行此工具,因为这非常耗时.

Rational Software工具可能是最杰出的工具,但也是最昂贵的工具.我发现Parasoft Insure ++ 的定价合理,尽管仍然有些陡峭供个人使用.我确定还有其他人,但我上次查看的是2008年,因此您可能会找到比以往更多的东西.
I''m not aware of any useful free or shareware tools of that kind, especially ones that go beyond memory leak detection. There are a few commercial products though, with prices in the 4-5 digits. And, IME, you might want to have or purchase an extra machine to run this tool on as it''s incredibly time-consuming.

Rational Software tools might be among the most prominent, but also the most costly. I''ve found Parasoft Insure++ to be reasonably priced, although still a bit steep just for personal use. I''m sure there are others, but last I checked was 2008, so you may be able to find more than I ever could.


这篇关于检测泄漏内存和缓冲区溢出问题的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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