On Mon, Jul 19, 2010 at 18:51, Bart Van Assche <[email protected]> wrote: > On Mon, Jul 19, 2010 at 6:41 PM, Bert Wesarg <[email protected]> > wrote: >> >> I would have expected, that when I do a read access on a memory >> location (ie. dereference the pointer), which was previously marked >> with VALGRIND_MAKE_MEM_UNDEFINED(), I get an error message from the >> memcheck tool. But I don't. I also don't get an error, when I do a >> read access on a pointer freshly returned from malloc(). I do get the >> "param write(buf) points to uninitialised byte(s)" warning, when I >> pass the pointer to write(2), but why not for a simple dereference >> statement? > > Memcheck doesn't complain at the time an undefined value is read but > at the time a conditional jump depends on an uninitialized value. A > quote from the memcheck manual > (http://valgrind.org/docs/manual/mc-manual.html): > > It is important to understand that your program can copy around junk > (uninitialised) data as much as it likes. Memcheck observes this and > keeps track of the data, but does not complain. A complaint is issued > only when your program attempts to make use of uninitialised data in a > way that might affect your program's externally-visible behaviour.
Thanks for the explanation. That makes perfectly sense. Bert > > Bart. > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
