博客地址:http://home.cnblogs.com/u/zengjianrong/

应用层内存溢出/越界/重复释放等问题检查工具(ASan)

https://github.com/google/sanitizers/wiki

https://github.com/google/sanitizers/wiki/AddressSanitizer

AddressSanitizer (aka ASan) is a memory error detector for C/C++. It finds:

This tool is very fast. The average slowdown of the instrumented program is ~2x (see AddressSanitizerPerformanceNumbers).

The tool consists of a compiler instrumentation module (currently, an LLVM pass) and a run-time library which replaces the malloc function.

功能强大,使用方便,默认集成到了gcc 4.8;

集成方便,只需使用clang +一些flag,同时还可以做过滤:例如已知函数的泄露

性能还不错,只是源程序×2的占用,相比valgrind要好得多;

可跟gdb/objdump -ldS使用;

posted @ 2019-11-01 15:48  black_man  阅读(935)  评论(0编辑  收藏  举报