|
From: Julian S. <js...@ac...> - 2005-10-17 23:25:17
|
> > Seriously now, my experience with Valgrind has been to the contrary. > > Sure, its tempting to dismiss error messages as false alarms. But so > > far, Valgrind was right about every error that I took the time to > > investigate carefully. You can't blame Valgrind for reporting cases of > > deliberate use of un-initialized values (and I've seen some of those). > > Quite agree on the last point, which is why we weren't. As another poster > said, it's actually quite common in comms related code for there to be > valid UMR's. The way I think about memcheck is slightly different. Memcheck cannot exactly partition all possible programs into those which do really use uninitialised values and those which don't. But mostly it's pretty good. Nevertheless there is a set of programs which it incorrectly classifies. For that set, it leans in the direction of reporting an error even when one doesn't exist. The reason is simple: you can usually make it shut up by adding a few unnecessary initialisations in the right place. The KDE folks did that, I believe, at some point in the KDE 3.0 line. Once you've made it shut up, you at least know that your program is now (probably) safe against use of uninitialised values. The alternative is to make it not report errors from such programs. That seems more convenient, but from an absolutist perspective of detecting all possible errors (so as to enable programmers to maximise software reliability, which was the original design goal for memcheck), it seems a poor alternative. In practice the fact that large systems like Qt4 and KDE 3.X run essentially with zero complaints on memcheck leads me to believe that the strategy is a reasonable one. J |