在 linux 上查找泄漏的 valgrind (memcheck) 的替代方法? [英] Alternative to valgrind (memcheck) for finding leaks on linux?
问题描述
我有一个使用各种第三方共享对象库的 linux x86 应用程序.我怀疑这些库正在泄漏内存(因为它不可能是我的代码;-)
I have a linux x86 application that makes use of various third-party shared-object libraries. I suspect these libraries are leaking memory (since it can't possibly be my code ;-)
我尝试了可信赖的 valgrind,但它死得很惨,因为 其中一个第三方库正在使用一个晦涩的 x86 指令,该指令valgrind 没有实现.
I tried the trusty valgrind, but it died a horrible death because one of the third-party libraries is using an obscure x86 instruction that valgrind doesn't implement.
我发现了对 DUMA 的建议 和试一试(使用 LD_PRELOAD 技术在运行时引入 DUMA),但它中止了对未通过 DUMA 分配的内存的自由操作的抱怨(几乎可以肯定是其中一个静态对象的某个构造函数)前面提到的第三方库).
I found a recommendation for DUMA and gave it a try (using the LD_PRELOAD technique to bring DUMA in at run-time), but it aborted complaining about a free operation on memory that wasn't allocated via DUMA (almost certainly by some constructor of a static object in one of the previously mentioned third-party libraries).
是否有其他运行时可链接(或不需要重新编译/重新链接)的工具可以在 linux 上运行?
Are there other run-time-linkable (or otherwise not requiring a recompilation/relink) tools around that will work on linux?
推荐答案
TotalView 调试器(或更准确地说,它的 Memscope)具有类似于 Valgrind 的功能集.
The TotalView debugger (or, more precisely, its Memscope) has a feature set similar to the one of Valgrind.
您也可以尝试电动围栏 (原作者链接)(DUMA 的起源)用于缓冲区溢出或 touch-after-free 情况(但不适用于 memleaks).
You can also try Electric Fence (original author's link) (the origin of DUMA) for buffer overflows or touch-after-free cases (but not for memleaks, though).
这篇关于在 linux 上查找泄漏的 valgrind (memcheck) 的替代方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!