valgrind

Valgrind and CUDA: Are reported leaks real?

独自空忆成欢 提交于 2019-11-29 04:01:13
I have a very simple CUDA component in my application. Valgrind reports a lot of leaks and still-reachables, all related to the cudaMalloc calls. Are these leaks real? I call cudaFree for every cudaMalloc . Is this valgrind's inability to interpret GPU memory allocation? If these leaks are not real, can I suppress them and have valgrind only analyse the non-gpu part of the application? extern "C" unsigned int *gethash(int nodec, char *h_nodev, int len) { unsigned int *h_out = (unsigned int *)malloc(sizeof(unsigned int) * nodec); char *d_in; unsigned int *d_out; cudaMalloc((void**) &d_in,

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

﹥>﹥吖頭↗ 提交于 2019-11-29 02:49:00
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 tried this. I compiled and installed to a local directory ( ~/GCC_Valgrind/gcc_install ) a new GCC version

Using valgrind to spot error in mpi code

风格不统一 提交于 2019-11-29 02:36:24
I have a code which works perfect in serial but with mpirun -n 2 ./out it gives the following error: ./out': malloc(): smallbin double linked list corrupted: 0x00000000024aa090 I tried to use valgrind such as: valgrind --leak-check=yes mpirun -n 2 ./out I got the following output: ==3494== Memcheck, a memory error detector ==3494== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==3494== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==3494== Command: mpirun -n 2 ./out ==3494== Grid_0/NACA0012.msh Grid_0/NACA0012.msh >>> Number of cells: 7734 >>> Number of

valgrind mac os mem leak

馋奶兔 提交于 2019-11-29 01:45:45
Today I installed valgrind on my Mac os x 10.6 and tried to test it out. And it turned out to be weird memory leaks in the system. What I did was just create simple c file that get some heap memory and immediately free it. When I ran valgrind it showed something like this Realfrees-MacBook-Pro:C Realfree$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./a.out ==2621== Memcheck, a memory error detector ==2621== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2621== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==2621== Command: ./a.out =

Can valgrind output partial reports without having to quit the profiled application?

纵饮孤独 提交于 2019-11-29 01:11:58
问题 I want to check a long running process for memory leaks with valgrind. I suspect the memory leak I'm after might happen only after several hours of execution. I can run the app under valgrind and get the valgrind log just fine, but doing so means I have to quit the application and start it again anew for a new valgrind session for which I would still have to wait several hours. Is it possible to keep valgrind and the app running and still get valgrind's (partial) data at any point during

Callgrind: Profile a specific part of my code

你说的曾经没有我的故事 提交于 2019-11-29 01:05:54
问题 I'm trying to profile (with Callgrind) a specific part of my code by removing noise and computation that I don't care about. Here is an example of what I want to do: for (int i=0; i<maxSample; ++i) { //Prepare data to be processed... //Method to be profiled with these data //Post operation on the data } My use-case is a regression test, I want to make sure that the method in question is still fast enough (something like less than 10% extra instructions since the last implementation). This is

Locate bad memory access on Solaris

好久不见. 提交于 2019-11-29 00:08:35
On Linux, FreeBSD and other systems I have valgrind for checking for memory errors like invalid reads and similar. I really love valgrind. Now I have to test code on Solaris/OpenSolaris and can't find a way to get information on invalid reads/writes in an as nice way (or better ;-)) as valgrind there. When searching for this on the net I find references to libumem , but I get only reports about memory leaks there, not invalid access. What am I missing? The dbx included with the Sun Studio compilers includes memory access checking support in its "Run Time Checking" feature (the check subcommand

valgrind: failed to start tool 'memcheck' for platform 'x86-linux'

∥☆過路亽.° 提交于 2019-11-28 21:35:09
There comes a time in life of a developer when one gets this error valgrind: failed to start tool 'memcheck' for platform 'x86-linux' I do not see myself as an expert Valgrind user, but I understand output of Valgrind enough to catch memory leaks in my C programs. The other day I launched a personal project in assembly language and used standard C memory routines (calloc, realloc, free) for its memory requirements. The program grew complex and I wanted to be sure I am not leaking any memory (and also to be sure I am leaking memory where I know I am leaking at that stage - amid development),

Valgrind and Java

人走茶凉 提交于 2019-11-28 21:21:17
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 was not useful. Running the program without Valgrind or without the --trace-children flag is fine. Does

Memory not freed but still reachable, is it leaking?

空扰寡人 提交于 2019-11-28 20:46:00
By checking with valgrind, I see that 5 blocks of memory were not freed after terminating my program, but they are still reachable. Do I need to be bothered by it? And how it happens? zhanwu@gelata:~/sandbox$ valgrind ./a.out ==2430== Memcheck, a memory error detector ==2430== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2430== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==2430== Command: ./a.out ==2430== Hello world! Thread1 returns 1 Thread2 returns 10 Thread3 returns 10 ==2430== ==2430== HEAP SUMMARY: ==2430== in use at exit: 1,590 bytes in 5