I have been looking for a similar post to mine without success. I am working with a code that so far seems to be deterministic and is as of now working properly. However when running Valgrind memcheck on it I get thousands of warnings all referencing to "conditional jump or move depends on unninitialised value". When tracing the error, valgrind trace it back to brk and sbrk functions. I do not understand why this is happening?, and more importantly how to fix it?. Below a portion of my code.
navSolutions->channel.satPositions = (fl64 **) calloc(3 , sizeof(fl64*));
ERRORCHECK(navSolutions->channel.satPositions == NULL)
navSolutions->channel.satPositionsOld = (fl64 **) calloc(3 , sizeof(fl64*));
ERRORCHECK(navSolutions->channel.satPositionsOld == NULL)
It is also relevant that a lot of these calls happen when calling free() for each of the pointers I allocate memory to. ANy help would be great. Thanks in advance
As part of the quick replies here is the extra information requested: Hello all again, thanks for the quick answers. My code code is being run in Linux Mint 17.2 Cinamon 64 bit. I am also using the following version of gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4 and valgrind version 3.10.1. I also tried the advice given by Nate Eldredge without success. Here are some of the valgrind ouput
==25494== Conditional jump or move depends on uninitialised value(s)
==25494== at 0x4669D7: _int_malloc (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
==25494== by 0x4695C5: calloc (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
==25494== by 0x40C1F5: initNavSolution (initNavSolutions.c:57)
==25494== by 0x401714: nav_init (nav_init.c:35)
==25494== by 0x40107B: main (main.c:38)
==25494== Uninitialised value was created
==25494== at 0x4BA9CC: brk (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
==25494== by 0x490C34: sbrk (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
==25494== by 0x454793: __libc_setup_tls (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
==25494== by 0x4543FD: (below main) (in /home/glonass/Documents/EclipseProjects/pyxis/bin/nav/navexe)
Thanks all in advance again