From: Lee D. <lee...@mi...> - 2003-06-24 15:49:21
|
Did your random data come from, say, the openssl random function? Or something similar? The root cause would be that those functions xor in random data into the buffer without first initializing it. Doing so is good for random-ness (adds some entropy) but valgrind keeps track that the memory was never "properly" written (and xor onto itself doesn't fool valgrind) so it gets reported. you can get rid of the valgrind message by initializing your buffer before calling the rand functions. -lee > -----Original Message----- > From: val...@li... > [mailto:val...@li...]On Behalf > Of Vincent > Penquerc'h > Sent: Tuesday, June 24, 2003 6:17 AM > To: 'Stephane Donze'; val...@li... > Subject: RE: [Valgrind-users] Uninitialised values > > > > This function does a lot of left shifts, right shifts and other > > bit-level stuff. Is it possible that my data accidentally > contains the > > bit pattern used by valgrind to trace uninitialised data ? > > AFAIK, Valgrind doesn't rely on any pattern in the actual data to > detect uninitialized data, especially as it can detect this at the > bit level (you'd have to choose either 0 or 1 to mean "uninitialized" > for a bit, which makes it hard to avoid the pattern :)) > > Valgrind maintains separate validity/addressability bits, but that > is outside your program, so you don't see it. > It's possible that Valgrind gets confused, if some insn wrongly > sets/checks validity flags. Or, maybe you are encoding more than > the actual data ? Or do you mean random data, as initialized via > a pseudo random number generator, or as whatever happened to lie > in memory at the time (in which case you will get undefinedness) ? > > -- > Vincent Penquerc'h > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU > Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly > Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |