valgrind

Valgrind: Invaild read of size 8

I have been working on an open source project for awhile, http://gtkworkbook.sourceforge.net/, and recently ran into an issue that just seems like I am going in circles. I'm pretty sure there is a heap problem but I have been looking at this code too long to figure out exactly what it is. So, in brief, what I am doing is reallocating a...

Valgrind Bus Error

I generate a makefile using qmake and then pass the following arguments to valgrind valgrind --tool=memcheck --leak-check=yes filename inputfilename where filename is the name of the executable generated and inputfilename is the name of the input file required as input for the executable Instead of getting any output related to th...

PIN or Valgrind with Managed C++?

I was wondering what experiences you have had using instrumentation tools with managed C++? PIN: http://www.pintool.org/ Valgrind: http://www.valgrind.org Thanks. ...

How well does Valgrind handle threads and machine-level synchronization instructions?

I have a highly parallel Windows program that uses lots of threads, hand-coded machine synchronization instructions, and home-rolled parallel-safe storage allocators. Alas, the storage management has a hole (not a synchonization hole in the allocators, I'm pretty sure) and I'd like to find it. Valgrind has been suggested as a good tool...

How can I monitor memory usage of php in linux?

Hi, I have used valgrinds massif tool to monitor memory usage in the past. Does anyone know how to capture memory use of php processes that are spawned on a linux lighttpd server? I have found that Valgrind can not attach to a prerunning process (and I would not know the PID of the php process before hand anyway) I only see lighttpd...

Helgrind for Windows?

Helgrind is a Valgrind tool for detecting synchronisation errors in C, C++ and Fortran programs that use the POSIX pthreads threading primitives. Anyone knows an equivalent tool for windows? After googling a bit I haven't found anything... ...

Malloc, string pointers, and Valgrind

My program is like this (main.c): #include <stdlib.h> #include <stdio.h> void main(){ char *first="hello "; char *second="world!"; char *seq=(char *)malloc((strlen(first)+1)*sizeof(char)); strcat(strcpy(seq,first),second); printf("%s\n",seq); free(seq); } and I debug with the tool valgrind, it said that($:valgrind --tool=m...

Valgrind vs Purify

Which one is better on Linux? Valgrind or Purify What is your opinion of using them? ...

how do i valgrind memcheck on every instance of Process without starting it via valgrind command options

Hi All, how do i do a valgrind memcheck on every instance of Process without starting it via valgrind command options. Is there a way to keep the monitoring options saved on a process rather than starting up the process every-time with valgrind command? In Microsoft Application Verifier if an application is specified to be monitored, ...

Cachegrind interpretation

Hi I am using valgrind-cachegrind for my L2 cache bottlenecks and below is a single line output of the command valgrind --tools=cachegrind EXECUTABLE Output: ==3420== Cachegrind, an I1/D1/L2 cache profiler. ==3420== I refs: 104,260,064,149 ==3420== I1 misses: 1,678,402 ==3420== L2i misses: 227,620 ==3...

free() errors (debugging with valgrind)?

I have these structs: typedef struct _Frag{ struct _Frag *next; char *seq; int x1; int length; }Frag; typedef struct _Fragment{ int type; Frag *frag_list; }Fragment; And then I created a array Fragment *fragments=malloc(1,sizeof(Fragment)); // or more fragments->frag_list=malloc(1,sizeof(Frag)); // or more Frag *...

C++ Class instance array initalization

Hi, I have a class A as follows: class A { public: A() { printf("A constructed\n"); } ~A(); //no other constructors/assignment operators } I have the following elsewhere A * _a; I initalize it with: int count = ... ... _a = new A[count]; and I access it with int key = .... ....

Python memory leaks?

I am writing a python extension that seems to be leaking memory. I am trying to figure out the soure of the problem using valgrind. However, it seems that python itself is leaking memory according to valgrind. Using the following simple script: hello.py print "Hello World!" and doing > valgrind --tool=memcheck python ./hello.py...

getpwnam_r memory leak

I use getpwnam_r to handle client connections in my programs. Sadly enough, it seems to allocate a buffer it never frees. The relevant valgrind output: ==15774== 536 (104 direct, 432 indirect) bytes in 2 blocks are definitely lost in loss record 1 of 3 ==15774== at 0x4C24CFE: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memc...

How do I get the stack pointer in a Valgrind tool in a portable way?

I'm writing a Valgrind tool and in the instrumented code I need to pass the guest's stack pointer to a dirty function. What I'm currently doing to get the stack pointer is this: IRTemp temp = newIRTemp (sbOut->tyenv, gWordTy); addStmtToIRSB (sbOut, IRStmt_WrTmp (temp, IRExpr_Get (offsetof (Ve...

How to run Valgrind in parallel with our process so its performance doesn't decrease too much?

Hi, I need to use Valgrind to detect any memory access violations made in a server application. The server creates many threads. I suspect that there is a racing condition that causes the server to crash every 1 hour or so. We used Valgrind to analyze its memory usage but the server process' speed decreased dramatically. The server's sp...

Running valgrind in virtual machine

Hello, How much valid are the valgrind logs showing invalid accesses and data races,when running it in virtual machine and not in a native linux system. The reason being,in a virtual machine,everything is virtual. ...

Is it normal that running python under valgrind shows many errors with memory?

I've tried to debug memory crash in my Python C extension and tried to run script under valgrind. I found there is too much "noise" in the valgrind output, even if I've ran simple command as: valgrind python -c "" Valgrind output full of repeated info like this: ==12317== Invalid read of size 4 ==12317== at 0x409CF59: PyObject_Fre...

How to suppress "DWARF2 CFI reader: unhandled CFI instruction" error in valgrind output?

I'm quite new in using valgrind. I'm running tests for my C library. I've tryed to run it under valgrind and got some very valuable info about possible errors in my code. One thing that bothers me is beginning of every valgrind session is full of messages like this: DWARF2 CFI reader: unhandled CFI instruction 0:22 IIUC it's unrelated...

How can I get valgrind to tell me the address of each non-freed block of memory?

Valgrind tells me function xxx allocated memory which was not freed. Fine. It's proving more difficult than usual to trace however. To this end I have created numerous: #ifdef DEBUG fprintf(stderr, "something happening:%lx\n", (unsigned long)ptr); #endif So I just need to match these ptr addresses that are displayed with the addresse...