Re: [squid-users] Re: Maximum Resident Size

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 16 Jan 2013 19:22:15 +1300

On 16/01/2013 2:08 a.m., csn233 wrote:
> On Tue, Jan 15, 2013 at 5:27 PM, M A Young <m.a.young_at_durham.ac.uk> wrote:
>
>> It is bug 3567 - squid leaks httprequests if presented with a request with
>> NULL characters in the headers or an invalid HTTP version. It requires bad
>> requests from the client, but unfortunately we seem to have a badly behaved
>> app some people use here.
>>
>> Michael Young
> I'm certainly see a lot of "WARNING: HTTP header contains NULL
> characters", and a quick analysis of the frequency of these entries
> seem to correlate to the rate of memory growth, and that HttpRequest
> forms the biggest chunk of my memory usage.
>
> Is the one-liner patch applicable to both 3.1 and 3.2?

No the patch won't apply to 3.2 or later due to code additions in the
file. The problem with the patch particularly is that there are several
places in that function which do a "goto finish" and may leak the
request object, I suspect at least three of them are doing so.

I think a better fix is to change the pointer from a HttpRequest* to a
HttpRequest::Pointer. That way we ref-count the object created properly
and whenever the function exists it will get destructed properly instead
of leaking. Doing a quick test now and will add a patch for 3.2 to the
bug report if it builds.

Amos
Received on Wed Jan 16 2013 - 06:22:24 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 16 2013 - 12:00:03 MST