博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
valgrind检测linux程序内存泄露
阅读量:4321 次
发布时间:2019-06-06

本文共 1781 字,大约阅读时间需要 5 分钟。

1.可以在下载最新版本;

2.解压之后,打开README文件,查看软件的安装方法,一般都是./configure make make install这三步;

3.检查是否安装正确:

1 valgrind ls -l

我安装的时候出现如下错误:

1 # valgrind ls -l 2 ==13544== Memcheck, a memory error detector 3 ==13544== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. 4 ==13544== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info 5 ==13544== Command: ls -l 6 ==13544==  7  8 valgrind:  Fatal error at startup: a function redirection 9 valgrind:  which is mandatory for this platform-tool combination10 valgrind:  cannot be set up.  Details of the redirection are:11 valgrind:  12 valgrind:  A must-be-redirected function13 valgrind:  whose name matches the pattern:      strlen14 valgrind:  in an object with soname matching:   ld-linux.so.215 valgrind:  was not found whilst processing16 valgrind:  symbols from the object with soname: ld-linux.so.217 valgrind:  18 valgrind:  Possible fixes: (1, short term): install glibc's debuginfo19 valgrind:  package on this machine.  (2, longer term): ask the packagers20 valgrind:  for your Linux distribution to please in future ship a non-21 valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)22 valgrind:  that exports the above-named function using the standard23 valgrind:  calling conventions for this platform.  The package you need24 valgrind:  to install for fix (1) is called25 valgrind:  26 valgrind:    On Debian, Ubuntu:                 libc6-dbg27 valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo28 valgrind:  29 valgrind:  Cannot continue -- exiting now.  Sorry.

以上错误,是因为ubuntu还需要一个库:

1 sudo apt-get install libc6-dbg

安装完这个库之后再次运行valgrind ls -l

4.使用方式:

1 valgrind --tool=memcheck --leak-check=full ./main

 

转载于:https://www.cnblogs.com/leealways87/archive/2012/11/02/2750662.html

你可能感兴趣的文章
关于缓存击穿
查看>>
对innodb 拷贝文件实现数据库的方式(转)
查看>>
python知识点 2014-07-09
查看>>
FloatingActionButton的一点学习感悟
查看>>
ABAP CDS ON HANA-(10)項目結合して一つ項目として表示
查看>>
网站地址信息
查看>>
产品经理 - 登录 注册
查看>>
小白的python进阶历程------05.占位符
查看>>
CF414BMashmokh and ACMDP
查看>>
Notepad++ 通过g++编译
查看>>
JAVA基础2——类初始化相关执行顺序
查看>>
转:Zend Framework 重定向方法(render, forward, redirect)
查看>>
Linux下查看磁盘与目录的容量——df、du
查看>>
关于日记app的思考
查看>>
使用sencha的cmd创建项目时提示找不到\Sencha\Cmd\repo\.sencha\codegen.json
查看>>
如何快速启动一个Java Web编程框架
查看>>
MSP430单片机存储器结构总结
查看>>
文本框过滤特殊符号
查看>>
教育行业安全无线网络解决方案
查看>>
7个杀手级的开源监测工具
查看>>