valgrind

Valgrind Massif tool output graphical interface?

一曲冷凌霜 提交于 2019-11-27 17:14:25
I'm using Valgrind 3.3.1 with the Massif tool to profile the heap of a C++ application, and I'm wondering if there is a graphical tool to examine the textual outputfile file. Thanks for any suggestion. For anyone else who is still interested in graphical output of Massif from Valgrind please consider massif-visualizer , it is beautiful. You can find the project page at KDE-Apps . For Ubuntu you should build massif-visualizer from source or install package from Kubuntu-ppa repo: add-apt-repository ppa:kubuntu-ppa/backports apt-get update && apt-get install massif-visualizer There is a Qt

Helgrind (Valgrind) and OpenMP (C): avoiding false positives?

我怕爱的太早我们不能终老 提交于 2019-11-27 17:06:25
问题 The documentation for the Valgrind thread error detection tool Helgrind, found here warns that, if you use GCC to compile your OpenMP code, GCC's OpenMP runtime library ( libgomp.so ) will cause a chaos of false positive reports of data races, because of its use of atomic machine instructions and Linux futex system calls instead of POSIX pthreads primitives. It tells you that you can solve this problem, however, by recompiling GCC with the --disable-linux-futex configuration option. So I

Valgrind showing memory leak for printf and unused blocks

元气小坏坏 提交于 2019-11-27 16:07:47
#include <string.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ char *str = malloc(sizeof(char)*5); str = strcpy(str, "test"); printf("%s\n", str); free(str); return 0; } When I use Valgrind on my Mac (OS X, 10.9.5) I get the following message: ==77215== HEAP SUMMARY: ==77215== in use at exit: 29,211 bytes in 374 blocks ==77215== total heap usage: 451 allocs, 77 frees, 35,160 bytes allocated ==77215== ==77215== 4,096 bytes in 1 blocks are still reachable in loss record 76 of 76 ==77215== at 0x66CB: malloc (in /usr/local/Cellar/valgrind/3.10.0/lib/valgrind/vgpreload

Memory Leaks in GTK hello_world program

*爱你&永不变心* 提交于 2019-11-27 16:03:38
So... I'm trying to eliminate some memory leaks from my GTK+ 3 program. I though it would be a good idea to look back at some simple examples to see if there is some cleanup stuff I'm forgetting, but the hello_world program provided in the documentation has leaks too. (Valgrind output below). Are these leaks acceptable? If so, is there some other application I should be using to debug GTK programs? ==13717== Memcheck, a memory error detector ==13717== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==13717== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info =

Possible Memory Leak Valgrind in OSX El Capitan

人盡茶涼 提交于 2019-11-27 15:50:13
问题 I'm getting a warning for possibly lost: 2,064 bytes in 1 blocks when using Valgrind on OSX Yosemite. Is there a fix to this? I installed valgrind using brew. Below is an example of how to reproduce ~/cat hello.c int main() { return 123; } ~/uname -a Darwin mac.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64 i386 MacBookAir6,2 Darwin ~/clang --version Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.2

why pthread causes a memory leak

断了今生、忘了曾经 提交于 2019-11-27 15:27:26
Whenever I create a pthread, valgrind outputs a memory leak, For example the below code: #include <stdio.h> #include <unistd.h> #include <pthread.h> void *timer1_function (void *eit){ (void) eit; printf("hello world\n"); pthread_exit(NULL); } int main(void){ pthread_t timer1; pthread_create( &timer1, NULL, timer1_function, NULL); ///////line13 int i=0; for(i=0;i<2;i++){usleep(1);} return 0; } valgrind outputs ==1395== HEAP SUMMARY: ==1395== in use at exit: 136 bytes in 1 blocks ==1395== total heap usage: 6 allocs, 5 frees, 1,134 bytes allocated ==1395== ==1395== 136 bytes in 1 blocks are

Is it possible to make valgrind ignore certain libraries?

痴心易碎 提交于 2019-11-27 14:15:53
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? 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 error in the library is caused by a problem in your code or not. Assuming you are running the memcheck tool and

Why does valgrind say basic SDL program is leaking memory?

假装没事ソ 提交于 2019-11-27 13:58:56
Here is the SDL program: #include <SDL/SDL.h> int main(int argc, char** argv){ SDL_Init(SDL_INIT_VIDEO); SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE); SDL_Quit(); return 0; } Compiled with the command: g++ -o test test.cpp -lSDL And here is the output of valgrind: christian@christian-laptop:~/cpp/tetris$ valgrind --leak-check=full ./test ==3271== Memcheck, a memory error detector ==3271== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==3271== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright info ==3271== Command: ./test ==3271== =

Valgrind and Java

末鹿安然 提交于 2019-11-27 13:44:38
问题 I want to use Valgrind 3.7.0 to find memory leaks in my Java native code. I'm using jdk1.6.0._29. To do that, I have to set the --trace-children=yes flag. Setting that flag, I no longer can run valgrind on any java application, even a command like: valgrind --trace-children=yes --smc-check=all java -version will get the error message: Error occurred during initialization of VM Unknown x64 processor: SSE2 not supported I've seen this link: https://bugs.kde.org/show_bug.cgi?id=249943, but it

Android valgrind build fails

╄→尐↘猪︶ㄣ 提交于 2019-11-27 12:31:29
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 directory `/home/matt/Desktop/valgrind/valgrind-3.8.1' Making all in include make[2]: Entering directory `/home