Valgrind的主要功能(结合memcheck工具)
1,使用未初始化的内存 (Use of uninitialised memory)
2,使用已经释放了的内存 (Reading/writing memory after it has been free'd)
3,使用超过 malloc分配的内存空间(Reading/writing off the end of malloc'd blocks)
4,对堆栈的非法访问 (Reading/writing inappropriate areas on the stack)
5,申请的空间是否有释放 (Memory leaks -- where pointers to malloc'd blocks are lost forever)
6, malloc/free/new/delete申请和释放内存的匹配(Mismatched use of malloc/new/new [] vs free/delete/delete [])
7, src和dst的重叠(Overlapping src and dst pointers in memcpy() and related functions)
在ubuntu下安装valgrind
如果下载的valgrind版本为3.5.0安装的时候,出现错误提示,显示glibc版本为2.0---2.10,
这是因为现在使用版本比软件要求的高,可以使用sudo apt-get install valgrind 安装