valgrind

std::list remove calling delete on pointer?

I ran valgrind on my program because of a segfault I can't figure out. It detected a problem here... Address 0x75c7670 is 0 bytes inside a block of size 12 free'd at 0x4024851: operator delete(void*) (vg_replace_malloc.c:387) by 0x805F6D8: std::list<Object*, std::allocator<Object*>::remove(O bject* const&) (new_allocator.h:95) T...

What does unhandled CFI instruction 0:50 mean?

I am using valgrind to debug a c++ program. At the beginning it says: DWARF2 CFI reader: unhandled CFI instruction 0:50 I have googled this, but have been unable to find an explanation as to what this means. Thanks in advance. ...

Testing iPhone app with Valgrind

I have terrific bug "object was modified after being freed", so I tend to take valgrind. After successfull installation from their svn, doing little trick from here: http://landonf.bikemonkey.org/code/iphone/iPhone_Simulator_Valgrind.20081224.html and changing path to valgrind with my one, I get "Debugger terminated." with gdb log: ...

Valgrind losing symbol info

After running Valgrind, the resultant log file contains a number of errors that look like Conditional jump or move depends on uninitialised value(s) at 0x3D9863AA: ??? by 0x3D986287: ??? by 0x3D9854AC: ??? Uninitialised value was created by a heap allocation at 0x7FCC050: operator new(unsigned int) (vg_replace_malloc.c:214) by...

valgrind with ODBC Driver for DB2 gives error

I'm using the Valgrind's massif tool to measure the heap allocation of my application. with the valgrind, the application fails to connect to the DB2 with the below error: SQL1366N A security plug-in "IBMOSauthclient" processing error occurred on the client. Reason code = "7". Without the valgrind the application runs fine with connec...

valgrind : possibly lost can be treated as defintely lost ?

As title said,Can i treat the output of valgrind memcheck, "possibly lost" as "definitely lost" ? # Possibly lost, or “dubious”: A pointer to the interior of the block is found. The pointer might originally have pointed to the start and have been moved along, or it might be entirely unrelated. Memcheck deems such a block as “dubious”, b...

a simple boss-worker model using pthreads

Hi, I'm an amateur programmer that's experimenting using pthreads, to see to what extent a multi-threaded program can lead to efficiencies in a rather long computation I'm working on. The computation runs through a std::list< string > object, popping the first element of the list off, and farming it out to a thread that computes somet...

Why is this code failing under valgrind (helgrind)?

...

How to fix the valgrind pool allocator issue?

When I run Valgrind on my code, I get several thousand instances of 12 bytes in 1 blocks are possibly lost in loss record 545 of 29,459 at 0x7FCC050: operator new(unsigned int) (vg_replace_malloc.c:214) by 0x87E39B1: __gnu_cxx::new_allocator<T>::allocate(unsigned int, void const*) (new_allocator.h:89) ... ... From various ...

finding memory leaks in c code on linux enviroment

hello i got a problem using valgrind when i use it with valgrind --leak-check=full and afterwards the name of excution file it tells me in which blocks the memory leak is but when i cant find to which pointer i did use free. is there some sort of flag that tells the name of the pointer. if there is anyway to tell me where the leak is o...

leak detected using valgrind when using fopen

Hello, gcc 4.4.4 c89 valgrind 3.5.0. I am getting a leak detected when I open file using a file pointer. ==17681== in use at exit: 352 bytes in 1 blocks ==17681== total heap usage: 1 allocs, 0 frees, 352 bytes allocated ==17681== ==17681== 352 bytes in 1 blocks are still reachable in loss record 1 of 1 ==17681== at 0x400...

Where is the memory leak in this code and how to fix it?

In my project I have a method that creates a string from integers (using strcat) and writes it into a file. Unfortunately it does have a memory leak. While tracking that leak down I simplified my code to the following. I can't seem to locate or even fix it. This is the code: #include <stdio.h> #include <stdlib.h> #include <string.h> int...

Valgrind Possibly Lost - MYSQL

I've recently been running one of my apps through Valgrind but there's a few MYSQL related leaks I can't fix. I put the offending code in the most basic form and tested that; I got the same leaks. Should I just disregard them or am I doing something wrong? Code: #include <stdio.h> #include <stdlib.h> #include <mysql/mysql.h> int main...

Valgrind on the CBE

Hi, I need to debug a C application on the cell processor, and later to use valgrind for memory leaks. I checked on their website (supported platforms) but there is nothing about the CBE. Did anybody use successfully valgrind on the CBE? (Mostly for the SPE parts of the code) Thanks ...

Valgrind / Memory Errors

I'm receiving the following errors repeatedly throughout my code when I use valgrind. I'm not quite sure what these mean and I can't identify the uninitialized values. ==16795== Conditional jump or move depends on uninitialised value(s) ==16795== at 0x4A06E8A: strcmp (mc_replace_strmem.c:412) ==16795== by 0x4009C7: dictionary_add...

Valgrind Uninitialized Values (making a linked list data struct)

I've created a linked list class, but this function is producing valgrind errors based saying that there is a conditional jump based upon an uninitialized value in this function. I'm not exactly sure what I need to do to fix it. Essentially there is a node class for the linked list and this is iterating over all the nodes checking if t...

Valgrind errors in c libraries?

Valgrind is showing an uninitialised value of size 8 error. And occasionally, the below conditional jump on uninitialised value error. All I'm doing is printing a formatted string using the stdc++ library that comes with gcc and the built in vsnprintf. This is inside a method called format which is part of a custom string class. What n...

Use callgrind as a sampling profiler?

I've been searching for a Linux sampling profiler, and callgrind has come the closest to showing useful results. However the overhead is estimated at 20--100x slower than normal. Additionally, I'm only interested in time spent per function (with particular emphasis on blocking calls such as read() and write(), which no other profiler wil...

C++ valgrind possible leaks on STL string

Hi, I do not see the reason of the leak below. #include <iostream> #include <cstdlib> int fail(const std::string str) { std::cerr<< str << std::endl; exit(1); } const std::string usage() { std::string a = "a"; return a; } int main() { fail(usage()); return 0; } Valgrind says: ==7238== 14 bytes in 1 bloc...

gdb to debug double free not detected by valgrind (?)

About once every three times I run my program, malloc reports a double free error; e.g. myprogram(703,0xb06d9000) malloc: *** error for object 0x17dd0240: double free *** set a breakpoint in malloc_error_break to debug I've run the same code through valgrind more than a dozen times but it never reports a double free. I ran the code t...