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程序的更多相关文章

  1. ubuntu12.04下NFS链接开发板并测试交叉编译的第一个应用

    思路:配置网络->安装NFS->配置NFS->挂载NFS服务->Down文件执行.Okay lets go! 配置网络: 在配置网络之前,首先咱得搞定与开发板的交互工作,那么这 ...

  2. Ubuntu10.04下安装Qt4和创建第一个Qt程序

    1.首先安装Qt4并采用Qt Creator进行开发演示 (1)在Terminal中输入: sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfi ...

  3. Linux (Ubuntu12.04) 下开发工具安装和使用

    Linux (Ubuntu12.04) 下开发工具安装和使用 这里讲述的是关于在ubuntu12.04下面安装和使用各种IDE 开发环境和初步使用的知识.说一下背景:很多的开发基本都是在linux操作 ...

  4. Ubuntu12.04下安ns-3.29及Ubuntu换源方法

    目录 1.下载ns-3.29 2.安装gcc-4.9.2 3.编译.测试ns-3.29 第一种:更新,文章开头说的 第二种,更新源 主机型号:Ubuntu12.04 仿真环境版本:NS-3.29 安装 ...

  5. Ubuntu12.04下安装sourcenavigator-NG4.5阅读源代码

    大家知道Windows下有一个很好的查看源代码的软件sourceinsight,使用sourceinsight查看Linux内核代码.嵌入式软件开发中的C语言项目源代码.驱动程序代码很是方便.在Lin ...

  6. 阿里云ubuntu12.04下安装使用mongodb

    阿里云ubuntu12.04下安装mongodb   apt-get install mongodb 阿里云ubuntu12.04下卸载mongodb,同时删除配置文件     apt-get pur ...

  7. 在ubuntu12.04下编译android4.1.2添加JNI层出现问题

    tiny4412学习者,在ubuntu12.04下编译android4.1.2添加JNI层出现问题: (虚心请教解决方法) trouble writing output: Too many metho ...

  8. [置顶] ubuntu12.04下编译opencv程序

    ubuntu12.04下编译opencv程序 1.在ubuntu下安装好 opencv后(建议使用apt-get install 来安装) 2.使用程序FaceExaple.c来进行测试程序 #inc ...

  9. Ubuntu12.04下Qt连接MySQL数据库

    本文介绍在Ubuntu12.04 (64 bit) 下使用Qt 4.8.2连接MySQL(Ver 14.14 Distrib 5.5.43)数据库. 1.安装 Qt 和 MySQL 若未安装以上软件, ...

随机推荐

  1. linux网络编程常用头文件

    sys/types.h:数据类型定义 sys/socket.h:提供socket函数及数据结构 netinet/in.h:定义数据结构sockaddr_in arpa/inet.h:提供IP地址转换函 ...

  2. 深入浅出理解QTimeLine类

    网上找了下QTimeLIne类的介绍,要么就是代码一贴自己看去,要么就是说不到重点,正巧自己项目遇到这个类,在这里写一下,给需要的同学看下. 因为我最近需要有动画方面配合时间间隔触发QGraphics ...

  3. 141 Linked List Cycle(判断链表是否有环Medium)

    题目意思:链表有环,返回true,否则返回false 思路:两个指针,一快一慢,能相遇则有环,为空了没环 ps:很多链表的题目:都可以采用这种思路 /** * Definition for singl ...

  4. HTML5拖放

    HTML5拖放 <!doctype html> <html> <head> <meta charset="UTF-8"> <t ...

  5. Flask学习记录之使用Werkzeug散列密码

    数据库中直接存放明文密码是很危险的,Werkzeug库中的security能够方便的实现散列密码的计算 security库中 generate_password_hash(password,metho ...

  6. JS小技巧大本事(持续更新)

    1. 复制N个字符 String.prototype.repeat = function(num){ return (new Array(++num)).join(this); } var a = ' ...

  7. poj 1275 Cashier Employment

    http://poj.org/problem?id=1275 #include <cstdio> #include <cstring> #include <algorit ...

  8. [转]Kafka/Metaq设计思想学习笔记

    收集的一些kafka的信息: http://my.oschina.net/geecoodeer/blog/194829

  9. C++类型转换总结

    C风格的强制类型转换(Type Cast)很简单,不管什么类型的转换统统是:TYPE b = (TYPE)a.C++风格的类型转换提供了4种类型转换操作符来应对不同场合的应用. const_cast, ...

  10. Xamarin for OSX – SetUp

    正常情况联网会失败 按照安装顺序进行安装(mono framework->java sdk-> android sdk->xamarin studio->xamarin.and ...