valgrind

Is it possible to make valgrind ignore certain libraries?

若如初见. 提交于 2019-11-26 16:38:50
问题 Or preferably all of them instead of just my code? My program uses Gtk, Loudmouth and few other things, and these two (and some behind them, libgcrypto, libssl) are causing so many errors themselves that I'm unable to detect my own. Is it possible to make valgrind ignore things coming from deeper than my own code? 回答1: You can generate suppressions for the errors for the libraries, but I don't think you can exclude the libraries generally. Also it's hard to automatically know if a memory

Can't run a Java Android program with Valgrind

霸气de小男生 提交于 2019-11-26 16:21:15
I'm trying to start a Java program under Valgring like this (in adb shell): valgrind am start -a android.intent.action.MAIN -n com.me.myapp/.MainActivity I'm getting: ==2362== Memcheck, a memory error detector ==2362== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==2362== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==2362== Command: am ==2362== /system/bin/sh: am: No such file or directory bitek You have to create a script, lets call it start_valgrind.sh #!/system/bin/sh PACKAGE="com.example.hellojni" # Callgrind tool #VGPARAMS='-v --error-limit=no -

Android valgrind build fails

偶尔善良 提交于 2019-11-26 16:01:58
问题 Hello I'm trying to build valgrind for android-arm. On Linux Mint 13 it fails with: $ make echo "# This is a generated file, composed of the following suppression rules:" > default.supp echo "# " exp-sgcheck.supp xfree-3.supp xfree-4.supp glibc-2.X-drd.supp glibc-2.34567-NPTL-helgrind.supp glibc-2.X.supp >> default.supp cat exp-sgcheck.supp xfree-3.supp xfree-4.supp glibc-2.X-drd.supp glibc-2.34567-NPTL-helgrind.supp glibc-2.X.supp >> default.supp make all-recursive make[1]: Entering

How to start an android app with valgrind

家住魔仙堡 提交于 2019-11-26 15:35:58
问题 I've been searching for the last week trying to find an answer to this question. How do I start an Android app with valgrind? I know I can start an app with the 'am' command, but it starts the app and exits. I'm writing an app that uses the NDK for native C code, and I need to check it for suspected memory errors. Edit: I've learned a little more. You can "wrap" an app with a shell script. Here's the shell script I'm using: #!/system/bin/sh VGPARAMS='--error-limit=no' export TMPDIR=/data/data

What do the suppressed leaks mean in Valgrind?

陌路散爱 提交于 2019-11-26 14:44:08
问题 I have developed a pure-C implementation of FIFO lists (queues) in files fifo.h and fifo.c, and have written a test programme testfifo.c which I compile to ./bin/testfifo . The node structure is defined in list.h. I run my programme through Valgrind on OS X 10.6 like this valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./bin/testfifo and get the following output ==54688== Memcheck, a memory error detector ==54688== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al

使用 Valgrind 检测 C++ 内存泄漏

梦想的初衷 提交于 2019-11-26 11:04:45
Valgrind 的介绍   Valgrind 可以用来检测程序是否有非法使用内存的问题,例如访问未初始化的内存、访问数组时越界、忘记释放动态内存等问题。在 Linux 可以使用下面的命令安装 Valgrind: 1 2 3 4 5 6 $ wget ftp://sourceware.org/pub/valgrind/valgrind-3.13.0.tar.bz2 $ bzip2 -d valgrind-3.13.0.tar.bz2 $ tar -xf valgrind-3.13.0.tar $ cd valgrind-3.13.0 $ ./configure && make $ sudo make install 检测内存泄漏   Valgrind 可以用来检测程序在哪个位置发生内存泄漏,例如下面的程序: 1 2 3 4 5 6 7 8 # include <stdlib.h> int main () { int * array = malloc( sizeof( int)); return 0; }   编译程序时,需要加上 -g 选项: 1 $ gcc -g -o main_c main.c   使用 Valgrind 检测内存使用情况: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 $

How can I use valgrind with Python C++ extensions?

梦想与她 提交于 2019-11-26 10:29:20
问题 I have Python extensions implemented on C++ classes. I don\'t have a C++ target to run valgrind with. I want to use valgrind for memory check. Can I use valgrind with Python? 回答1: Yes, you can use valgrind with Python. You just need to use the valgrind suppression file provided by the Python developers, so you don't get a bunch of false positives due to Python's custom memory allocation/reallocation functions. The valgrind suppression file can be found here: http://svn.python.org/projects

How to profile memory usage?

陌路散爱 提交于 2019-11-26 09:41:12
问题 I am aware of Valgrind, but it just detects memory management issues. What I am searching is a tool that gives me an overview, which parts of my program do consume how much memory. A graphical representation with e.g. a tree map (as KCachegrind does for Callgrind) would be cool. I am working on a Linux machine, so windows tools will not help me very much. 回答1: Use massif, which is part of the Valgrind tools. massif-visualizer can help you graph the data or you can just use the ms_print

Finding the cause of a memory leak in Ruby

我们两清 提交于 2019-11-26 09:17:48
问题 I\'ve discovered a memory leak in my Rails code - that is to say, I\'ve found what code leaks but not why it leaks. I\'ve reduced it down to a test case that doesn\'t require Rails: require \'csspool\' require \'ruby-mass\' def report puts \'Memory \' + `ps ax -o pid,rss | grep -E \"^[[:space:]]*#{$$}\"`.strip.split.map(&:to_i)[1].to_s + \'KB\' Mass.print end report # note I do not store the return value here CSSPool::CSS::Document.parse(File.new(\'/home/jason/big.css\')) ObjectSpace.garbage

Is there a good Valgrind substitute for Windows?

淺唱寂寞╮ 提交于 2019-11-26 08:34:40
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a equally good program for Windows. 回答1: Some more good commercial tools: Purify Insure++ 回答2: As jakobengblom2 pointed out,