Re: Valgrind results

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Mon, 24 Mar 2008 13:56:46 +0100

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));
    }

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
Received on Mon Mar 24 2008 - 06:57:08 MDT

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