Hi,
On Thu, Jan 27, 2022 at 10:41:36AM +0100, Roberto Ragusa wrote:
On 1/22/22 10:05 PM, Mark Wielaard wrote:
> So I would give valgrind a 6/6 (100%) score :)
But if the compiler starts copying zeros on uninitialized memory,
valgrind loses any ability to detect the defect in the code.
Yes. So that is the compromise. You'll always get initialized zeros
for local variables, so any usage is defined (though probably buggy).
But some of the tools, like valgrind memcheck, will be unable to
detect the buggy code.
If you believe the tools we have are pretty bad to begin with and/or
not actually used by people to find such bugs then this is a good
compromise. If you believe the tools are pretty good for detecting
these issues (and I believe they are, the example given was just
unfortunate because some of the issues weren't actually bad code and
some others were rightfully optimized out, so would never trigger),
then it is a bad compromise. But we definitely need to encourage
people to use the tools more.
Cheers,
Mark