wget http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2
tar xvf valgrind-3.8.1.tar.bz2
cd valgrind-3.8.1/
./configure --prefix=/usr/local/webserver/valgrind
make
make install
http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2

通过Google 发现一个查看内存泄漏的工具 algrind,用一个例子测试了一下。

但是安装是发现一个问题,3.4 默认不支持linux-kernel 3.5 3.6 于是下了 3.8 在上面那个脚本的工作下~ 成功完成任务。

但是安装后报错了,

==17424== Memcheck, a memory error detector
==17424== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==17424== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==17424== Command: ls /
==17424== 

valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind:  
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:      strlen
valgrind:  in an object with soname matching:   ld-linux-x86-64.so.2
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux-x86-64.so.2
valgrind:  
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.  The package you need
valgrind:  to install for fix (1) is called
valgrind:  
valgrind:    On Debian, Ubuntu:                 libc6-dbg
valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
valgrind:  
valgrind:  Cannot continue -- exiting now.  Sorry.

阅读后,原来没有安装libc6-dbg

于是看看libc6-dbg 是单独一个包还是包含在某一个包内 

sudo apt-cache search libc6-dbg

结果显示包名就是libc6-dbg 可以直接下载 安装后就能用了。

posted on 2013-04-26 15:22  zengco2009  阅读(279)  评论(0编辑  收藏  举报