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

爷,独闯天下 提交于 2020-11-21 04:04:50

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使用;

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!