|
From: Nicholas N. <nj...@cs...> - 2006-06-04 22:26:11
|
On Sun, 4 Jun 2006, Bob Rossi wrote: >> Before the experts answer you, it sounds to me like maybe you're passing >> around some un-initialized value which happens to have the right value >> (or just a "better" value) when running under Valgrind. > > I thought valgrind would discover if unintialized values are being used > though. Isn't that true? In general, yes. But the execution environment under Valgrind is different to that natively -- memory is laid out in different ways, etc. Very occasionally this changes program behaviour; but when it does it's usually because the program is buggy, eg. it's got a wild memory read/write that may hit addressible, initialised memory uner Valgrind but not natively. I imagine something like that is happening here. It's unfortunate for the poor user because Memcheck then can't detect the problem. I heard of one person who chose to always run a program under Valgrind because it crashed natively but not under Valgrind! (I think Memcheck must have issued warnings, but maybe he didn't care and just used --tool=none.) Nick |