473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Problems with valgrind

Hi

I have been using valgrind to debug a program I have written in C++ and
it has been very helpful in eliminating memory errors/leaks. However, I
just recently discovered a bug and from what I can see it looks like
some kind of memory problem. However, when I run it through valgrind no
errors are reported and the bug seems to be gone! I print some status
from the program and at some point this becomes wrong but when the
program is run through valgrind the status printed is right!

How can valgrind change the output of my program and does this behaviour
give any clues as to what kind of bug I am looking for?

Thanks in advance.

/Andreas

Jul 22 '05 #1
2 2528
Andreas Andersen wrote:
I have been using valgrind to debug a program I have written in C++ and
it has been very helpful in eliminating memory errors/leaks. However, I
just recently discovered a bug and from what I can see it looks like
some kind of memory problem. However, when I run it through valgrind no
errors are reported and the bug seems to be gone! I print some status
from the program and at some point this becomes wrong but when the
program is run through valgrind the status printed is right!

How can valgrind change the output of my program and does this behaviour
give any clues as to what kind of bug I am looking for?


'valgrind' is off-topic here. But we can try to help you with your code.
You just need to read the FAQ and follow its advice. Find a copy of the
"Welcome" message (posted here weekly by Shiva), and take it from there.

V
Jul 22 '05 #2

"Andreas Andersen" <an*****************@daimi.au.dk> schrieb im
Newsbeitrag news:cs***********@news.cybercity.dk...
Hi

I have been using valgrind to debug a program I have written in C++
and it has been very helpful in eliminating memory errors/leaks.
However, I just recently discovered a bug and from what I can see it
looks like some kind of memory problem. However, when I run it
through valgrind no errors are reported and the bug seems to be
gone! I print some status from the program and at some point this
becomes wrong but when the program is run through valgrind the
status printed is right!

How can valgrind change the output of my program and does this
behaviour give any clues as to what kind of bug I am looking for?

Thanks in advance.


This sort of error come 95% from something like:
char a[9]; a[9]='x';
Bitch to find. Hopefully it's very new, so you can check the code you
wrote yesterday.
-Gernot
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jerald | last post by:
Running python 2.3.4 on valgrind (a tool like purify which checks the use of uninitialized memory, etc), gives a lot of errors. See below. jfj@cluster:~/> python -V Python 2.3.4...
6
by: Marco Chiarandini | last post by:
Dear all, I am experiencing a problem in the deallocation of STL data structures. In paritcular I create a vector of sets and insert integers in each set. I do not define any deallocator since...
2
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
5
by: Roman Mashak | last post by:
Hello, All! I already posted my question and received valuable feedbacks, I changed my code as was proposed here but still receive the same error of valgrind. SO, the code is: #define...
1
by: Nathan Bates | last post by:
Are the Python developers running Python under Valgrind? If not, FYI, Valgrind is a excellent memory-checker for Linux. Valgrind is reporting a ton of memory problems. Worrisome are "Conditional...
1
by: mfried | last post by:
Hi all, I'm testing an application using valgrind 3.2.0 unter Linux kernel 2.4. When the test are finished and the app terminates valgrind gives the error: --15631:0:aspacem Valgrind: FATAL:...
4
by: Simple Simon | last post by:
It's entirely possible that I'm completely in the wrong line of work, but I don't see what Valgrind is complaining about in this code. Invalid read/writes? If I free the within main(), rather...
0
by: Salvatore Iovene | last post by:
Hi, I'm using the pexpect module to spawn some processes in a testing environment. pexpect uses, internally, os.execv. What I need to do is valgrind python and get memory leaks from the spawned...
2
by: tvnaidu | last post by:
valgrind error - "failed to start tool 'memcheck' for platform x86-linux" no such file or dir copied all lib and bin files which are generated after I compiled valgrind package, when I run my exe...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.