Heap corruption detection tool for C++

2019-06-25 23:28发布

Is there any tool to help me detect heap corruption in C++? I can't provide source code because it's a big project. I can use any tool that works with Visual Studio or with xcode. The tool should work fine with multithreading. The problem is not very common, it appears after a long time and only in very special cases(they were not detected precisely!).

Thank you!

EDIT:

Thanks you all for your answers! I will test the tools and I will accept one answer after the tests.

4条回答
女痞
2楼-- · 2019-06-25 23:39

Valgrind is the defacto tool for doing memory instrumentation for native code. It, however, does not run on Windows (OS X is fine).

There are a few commercial tools which do run on Windows, and while they feature a GUI, are in my opinion inferior to Valgrind.

查看更多
劫难
3楼-- · 2019-06-25 23:44

The debugging tools for Windows include gflags and page heap which help detecting heap corruptions.

查看更多
放荡不羁爱自由
4楼-- · 2019-06-25 23:47
Summer. ? 凉城
5楼-- · 2019-06-25 23:48

On Mac OS X (which I presume is what you mean when you say Xcode), you have a whole bunch of memory debugging tools already, e.g. http://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-MallocOptions/index.html which lets you turn on heap checking via environment variables.

查看更多
登录 后发表回答