Problems with valgrind

A

Andreas Andersen

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
 
V

Victor Bazarov

Andreas said:
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
 
G

Gernot Frisch

Andreas Andersen said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top