|
From: Julian S. <js...@ac...> - 2005-05-30 07:26:34
|
Hi. This is an interesting one. First off, I can reproduce this using zlib-1.2.2 and the test program posted at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070, using current Valgrind 3 sources, on x86. I'm reluctant to add these suppressions without understanding what's going in on detail. A lot of thought and effort went into making Valgrind (Memcheck) have a low false-positive rate, and if this shows up a flaw in Memcheck's instrumentation scheme I want to know what it is. In http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070 Mark writes: > I went through that in detail about a year or two ago and concluded > that it was not a problem, and furthermore could not even cause > indeterminism in the result of deflating. It was intentional in the > design to improve speed. Mark, could you explain how the use of uninitialised values from memory is made safe here? I'm looking at this do { } while (*++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && scan < strend); and it's not clear how scan can be moved forward some indeterminate amount based on garbage in memory and yet the deflate result is well-defined. As background: Memcheck does occasionally generate false errors. These have been looked into quite extensively, and as far as I know always revolve around getting the x86 %eflags register into a partially defined state at high levels of optimisation. This one seems different -- removing -O3/2/1 from the compile flags does not make the report go away. An ideal outcome is that Mark explains how this behaviour is safe in zlib. I can then look at Memcheck's instrumentation phase to determine if/how it is possible to avoid these reports. J On Thursday 26 May 2005 14:07, Tilman Sauerbeck wrote: > Hi, > I suggest to add the following two suppressions to the default set: > > { > bogus warning in zlib > Memcheck:Cond > obj:/usr/lib/libz.so.1.2.2 > obj:/usr/lib/libz.so.1.2.2 > fun:deflate > fun:compress2 > } > { > bogus warning in zlib > Memcheck:Cond > obj:/usr/lib/libz.so.1.2.2 > obj:/usr/lib/libz.so.1.2.2 > fun:deflate > fun:compress2 > } > > According to Mark Adler, that bug is safe and it probably won't be > fixed: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070 > > Regards, > Tilman |