Re: Valgrind results

From: Amos Jeffries <squid3@dont-contact.us>
Date: Tue, 25 Mar 2008 10:23:21 +1300

Henrik Nordstrom wrote:
> On Mon, 2008-03-24 at 00:16 +1300, Amos Jeffries wrote:
>
>> I care about every potential cause of trouble in squid. Particularly
>> avoidable ones that pop up all the time. 'Zero errors' policy and all that.
>>
>> It may be that this is fixable by setting the first byte of the buffer
>> to '\0'. I'm just busy working on the other more serious ones myself
>> tonight.
>
> You need to set the whole buffer to 0.
>
> In Squid-2 we have the following fragment to deal with this warning:
>
> if (RUNNING_ON_VALGRIND) {
> /* Keep valgrind happy.. complains about uninitialized bytes otherwise */
> memset(&ev, 0, sizeof(ev));
> }

I found that in 3.x as well. It turns out those bits of valgrind code
only occur if both --enable-leakfinder and --with-valgrind-debug are
enabled.

My test script only had "--with-valgrind" which wasn't doing even the
job it needed to :-(

FWIW: Is there any reason why we need separate leakfinder and valgrind
modes?

>
> Alternatively one can spend a little time to teach valgrind about how
> epoll_ctl reads it's parameters.. The warning comes from the data member
> being an union of different sizes depending on the epoll_ctl call used..
>
> Regards
> Henrik
>

Amos

-- 
Please use Squid 2.6STABLE17+ or 3.0STABLE1+
There are serious security advisories out on all earlier releases.
Received on Mon Mar 24 2008 - 15:23:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:10 MDT