From: Edward M. <Edw...@ce...> - 2004-04-30 17:03:01
|
Hi, A colleague of mine has found some problems reported in his code, and he doesn't think that it's too serious. I would like to check that he is correct, and since I don't really know how valgrind works at a fine level, I was wondering if I could ask the list? The error is: ==30741== Conditional jump or move depends on uninitialised value(s) ==30741== at 0x4202D15A: __strtol_internal (in /lib/i686/libc-2.2.5.so) ==30741== by 0x64FB7C66: LArFCALCalculatorBase::GetElectrodes() (/usr/include/stdlib.h:301) ==30741== by 0x64FB14AB: LArFCAL1Calculator::LArFCAL1Calculator() (../src/LArFCAL1Calculator.cc:31) ==30741== by 0x64FB1238: LArFCAL1Calculator::GetInstance() (../src/LArFCAL1Calculator.cc:16) His response was that it looked like there were two char[3] arrays, but the last element of the array was unitialised, causing the valgrind error. He believed that compilers should normally initialize a character array to binary zero and so it shouldn't be a problem. My understanding of valgrind was that it ran the machine code, and so if it reports an error then the compiler HASN'T initialize the memory at all. Am I correct? Cheers, Ed |