Ubuntu12.04下使用valgrind内存测试工具测试Qt程序
1. 到官网http://valgrind.org/downloads/上下载valgrind最新版本;
2. 解压源码,执行./configure;make;make install后,默认安装到/usr/local/bin下,执行:
valgrind ls -l
3. 提示:
==== Memcheck, a memory error detector
==== Copyright (C) -, and GNU GPL'd, by Julian Seward et al.
==== Using Valgrind-3.7. and LibVEX; rerun with -h for copyright info
==== Command: ls -l
==== 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-.so.
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux-x86-.so.
valgrind:
valgrind: Possible fixes: (, short term): install glibc's debuginfo
valgrind: package on this machine. (, 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 () is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
大概是说我的glibc是个strip后的版本,需要下载debug版,debug版的名字是libc6-dbg。
执行:
sudo apt-get install libc6-dbg
4. 再次执行valgrind ls -l,输出:
==== Memcheck, a memory error detector
==== Copyright (C) -, and GNU GPL'd, by Julian Seward et al.
==== Using Valgrind-3.7. and LibVEX; rerun with -h for copyright info
==== Command: ls -l
====
total
drwxr-xr-x root root -- : bin
drwxr-xr-x root root -- : boot
drwxr-xr-x root root -- : cdrom
drwxr-xr-x root root -- : dev
drwxr-xr-x root root -- : etc
drwxr-xr-x root root -- : home
lrwxrwxrwx root root -- : initrd.img -> boot/initrd.img-2.6.--generic
drwxr-xr-x root root -- : lib
drwxr-xr-x root root -- : lib32
lrwxrwxrwx root root -- : lib64 -> /lib
drwx------ root root -- : lost+found
drwxr-xr-x root root -- : media
drwxr-xr-x root root -- : mnt
drwxr-xr-x root root -- : opt
dr-xr-xr-x root root -- : proc
drwx------ root root -- : root
drwxr-xr-x root root -- : sbin
drwxr-xr-x root root -- : selinux
drwxr-xr-x root root -- : srv
drwxr-xr-x root root -- : sys
drwxrwxrwx root root -- : tftpboot
drwxrwxrwt root root -- : tmp
drwxr-xr-x root root -- : usr
drwxr-xr-x root root -- : var
lrwxrwxrwx root root -- : vmlinuz -> boot/vmlinuz-2.6.--generic
drwxrwxrwx root root -- : work
====
==== HEAP SUMMARY:
==== in use at exit: , bytes in blocks
==== total heap usage: , allocs, , frees, , bytes allocated
====
==== LEAK SUMMARY:
==== definitely lost: bytes in blocks
==== indirectly lost: bytes in blocks
==== possibly lost: bytes in blocks
==== still reachable: , bytes in blocks
==== suppressed: bytes in blocks
==== Rerun with --leak-check=full to see details of leaked memory
====
==== For counts of detected and suppressed errors, rerun with: -v
==== ERROR SUMMARY: errors from contexts (suppressed: from )
看来ls这个命令是没有任何内存问题的。。。
Ubuntu12.04下使用valgrind内存测试工具测试Qt程序的更多相关文章
- ubuntu12.04下NFS链接开发板并测试交叉编译的第一个应用
思路:配置网络->安装NFS->配置NFS->挂载NFS服务->Down文件执行.Okay lets go! 配置网络: 在配置网络之前,首先咱得搞定与开发板的交互工作,那么这 ...
- Ubuntu10.04下安装Qt4和创建第一个Qt程序
1.首先安装Qt4并采用Qt Creator进行开发演示 (1)在Terminal中输入: sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfi ...
- Linux (Ubuntu12.04) 下开发工具安装和使用
Linux (Ubuntu12.04) 下开发工具安装和使用 这里讲述的是关于在ubuntu12.04下面安装和使用各种IDE 开发环境和初步使用的知识.说一下背景:很多的开发基本都是在linux操作 ...
- Ubuntu12.04下安ns-3.29及Ubuntu换源方法
目录 1.下载ns-3.29 2.安装gcc-4.9.2 3.编译.测试ns-3.29 第一种:更新,文章开头说的 第二种,更新源 主机型号:Ubuntu12.04 仿真环境版本:NS-3.29 安装 ...
- Ubuntu12.04下安装sourcenavigator-NG4.5阅读源代码
大家知道Windows下有一个很好的查看源代码的软件sourceinsight,使用sourceinsight查看Linux内核代码.嵌入式软件开发中的C语言项目源代码.驱动程序代码很是方便.在Lin ...
- 阿里云ubuntu12.04下安装使用mongodb
阿里云ubuntu12.04下安装mongodb apt-get install mongodb 阿里云ubuntu12.04下卸载mongodb,同时删除配置文件 apt-get pur ...
- 在ubuntu12.04下编译android4.1.2添加JNI层出现问题
tiny4412学习者,在ubuntu12.04下编译android4.1.2添加JNI层出现问题: (虚心请教解决方法) trouble writing output: Too many metho ...
- [置顶] ubuntu12.04下编译opencv程序
ubuntu12.04下编译opencv程序 1.在ubuntu下安装好 opencv后(建议使用apt-get install 来安装) 2.使用程序FaceExaple.c来进行测试程序 #inc ...
- Ubuntu12.04下Qt连接MySQL数据库
本文介绍在Ubuntu12.04 (64 bit) 下使用Qt 4.8.2连接MySQL(Ver 14.14 Distrib 5.5.43)数据库. 1.安装 Qt 和 MySQL 若未安装以上软件, ...
随机推荐
- 【NEERC 2003】有向图破坏
[题目描述] Alice和Bob正在玩如下的游戏.首先Alice画一个有N个顶点,M条边的有向图.然后Bob试着摧毁它.在一次操作中他可以找到图中的一个点,并且删除它所有的入边或所有的出边. Alic ...
- 利用C++ RAII技术自动回收堆内存
在C++的编程过程中,我们经常需要申请一块动态内存,然后当用完以后将其释放.通常而言,我们的代码是这样的: 1: void func() 2: { 3: //allocate a dynamic me ...
- struts1、ajax、jquery、json简单实例
1.页面ajax代码,使用$.ajax,获得json对象后each $.ajax({ type:"GET", url:ctx + "/uploadImg.do" ...
- PHP 读取/导出 CSV文件
工作中经常会有遇到导入/导出的需求,下面是常用的方法.读取CSV文件,可以分页读取,设置读取行数,起始行数即可.导出CSV文件,用两种方法进行实现. /** * 读取CSV文件 * @param st ...
- php图片上传
//处理图片 private function imageDeal($param){ $arrType=array('image/jpg','image/bmp','image/png','image ...
- 查询一周最近一周的数据,date String 随意转换,更有疯狂的排序
--查看一周随访的详情70007PROCEDURE GET_PATIENT_WEEKFU ( userId in NUMERIC, time in date, V_LIST OUT MYCURSOR ...
- C语言学习笔记--枚举&结构体
枚举 枚举是一种用户定义的数据类型,它用关键字enum以如下语法格式来声明: enum 枚举类型名字 {名字0,名字1,...,名字n}: 枚举类型名字通常并不真的使用,要用的是大括号里面的名字,因为 ...
- 使用Protractor进行AngularJS e2e测试案例
环境: y@y:karma-t01$ protractor --version Version y@y:karma-t01$ node -v v4.2.2 y@y:karma-t01$ y@y:kar ...
- angular2 学习笔记 ( rxjs 流 )
RxJS 博大精深,看了好几篇文章都没有明白. 范围牵扯到了函数响应式开发去了... 我对函数式一知半解, 响应式更是第一次听到... 唉...不过日子还是得过...混着过先呗 我目前所理解的很浅, ...
- word页面不对齐,如何解决?
http://blog.163.com/haibianfeng_yr/blog/static/34572620201157105439516/