|
From: Arnab B. <arn...@gm...> - 2005-05-26 18:15:44
|
Hi All,
I have some queries regarding the log messages generated by
valgrind when a leak check is performed. I performed a leak-check on
my program with the following options :
--leak-check=3Dyes --show-reachable=3Dyes.
The error message depicted that there are some uninitialized
variables, the log generated is as follows :
=3D=3D23922=3D=3D Use of uninitialised value of size 4
=20
=3D=3D23922=3D=3D Conditional jump or move depends on uninitialised va=
lue(s)
=20
My question is, when are this messages logged by valgrind i.e. what
errors in the program (which is under test) are this messages logged ?
I went through my code and found that everything is fine and the
variables used are initialised properly, so I am wondering what other
possible errors may lead to these type of message.
Any suggestions would be of great help.
Regards
-Arnab
|
|
From: Jeremy F. <je...@go...> - 2005-05-29 05:28:15
|
Arnab Bakshi wrote:
>Hi All,
>
> I have some queries regarding the log messages generated by
>valgrind when a leak check is performed. I performed a leak-check on
>my program with the following options :
>
> --leak-check=yes --show-reachable=yes.
>
> The error message depicted that there are some uninitialized
>variables, the log generated is as follows :
>
> ==23922== Use of uninitialised value of size 4
>
> ==23922== Conditional jump or move depends on uninitialised value(s)
>
>
> My question is, when are this messages logged by valgrind i.e. what
>errors in the program (which is under test) are this messages logged ?
>
> I went through my code and found that everything is fine and the
>variables used are initialised properly, so I am wondering what other
>possible errors may lead to these type of message.
>
Even if you initialize a variable properly, if you later copy an
undefined value into it, it can produce this message. You need to look
at the dataflow of your program to see how an undefined value got where
it did. Including valgrind/memcheck.h and using
VALGRIND_CHECK_DEFINED() will help.
J
|