If you\'ve used Memcheck (from Valgrind) you\'ll probably be familiar with this message...
Conditional jump or move depends on uninitialized value(s)<
Can you post a more complete sample? It's hard to see how there would be that particular error with out some form of goto or flow changing statement.
I most commonly see this error in code like the following
MyClass s1;
...
if ( someCondition ) {
goto Foo:
}
MyClass s2;
Foo:
cout << s2.GetName();
This code is fundamentally incorrect. The reason why is that even though s2 has a constructor, it's not executed if someCondition is true. The goto statement will jump over the initialization and at the last line of the program s2 will be uninitialized and essentially point to garbage.
EDIT
You may also want to check out this page which gives hints on how to decipher this particular valgrind error
https://computing.llnl.gov/code/memcheck/#deciphering4
Addendum
Another common cause for this I've just found is when you pass over some integer constants to a variadic function, which are put on the stack as ints, but when the callee gets it as longs, you've got a problem on 64-bit machines.
I was almost about to give up and just consider valgrind being stupid, then I've realised that simply casting it to long fixes it.
So my upshot is: take this messages seriously.
It would be very helpful if you can post more code, especially from the part where valgrind thinks the error is.
If this happens every time you instantiate the class, you probably forgot to initialize one of the members in the constructor.
And yes: You should worry about this error, those guys can really bite you.
In 64-bits machine. Usually, int takes 4 bytes in memory. But long will take 8 bytes in memory. So simply refer an int value as long format will cause totally incorrect result. An convert is needed in this situation.
You can add the flag --track-origins=yes
to valgrind and it will give you information on the sources of uninitialised data. It runs slower, but can be helpful.
Source: Valgrind User Manual
If Valgrind states that a value is not initialised, then in 99.5% it is really not initialised. Normally, when compiler reports use of an uninitialised value (-Wuninitialized in GCC), you check for inline unrolls, as your uninitialised value can be declared (and not initialised) for example 10 levels of inline function "calls" (or template unrolls) higher, than actual GCC report. Valgrind does the same, but in runtime. So you should check whole path in which uninitialised value travelled from place of being declared (and not initialised), to the place where it's actually used. The path can be for example: cascade of function calls, where each function passes its arguments (and possibly uninitialised value) to next function. Valgrind will report in last function, when the value is actually used.
Generally you should not ignore what Valgrind states. Valgrind is not a simple trace program. It can be seen as a virtual machine:
Valgrind is in essence a virtual machine using just-in-time (JIT) compilation techniques, including dynamic recompilation. Nothing from the original program ever gets run directly on the host processor. Instead, Valgrind first translates the program into a temporary, simpler form called Intermediate Representation (IR), which is a processor-neutral, SSA-based form. After the conversion, a tool (see below) is free to do whatever transformations it would like on the IR, before Valgrind translates the IR back into machine code and lets the host processor run it. Even though it could use dynamic translation (that is, the host and target processors are from different architectures), it doesn't. Valgrind recompiles binary code to run on host and target (or simulated) CPUs of the same architecture. (Wikipedia)
The error does not seem to come from your code, but a library you are using.
Valgrind comes with some default error suppression, but that probably does not cover the library you are using.
The error-checking tools detect numerous problems in the base libraries, such as the GNU C library, and the X11 client libraries, which come pre-installed on your GNU/Linux system. You can't easily fix these, but you don't want to see these errors (and yes, there are many!) So Valgrind reads a list of errors to suppress at startup. A default suppression file is created by the ./configure script when the system is built.
You can create your own error suppressions that you know are irrelevant to your code.
See the similar SO question Why does Valgrind not like my usage of glutCreateWindow?