[squid-dev] [PATCH] Uninitialised errors during Squid startup

Amos Jeffries squid3 at treenet.co.nz
Thu Jun 9 04:27:01 UTC 2016


On 9/06/2016 12:52 a.m., Eduard Bagdasaryan wrote:
> Hello,
> 
> This patch fixes valgrind-discovered trunk errors.
> 
> During start-up, Valgrind reported many errors with a similar message:
> "Use of uninitialised value of size 8...". These errors were caused by
> HttpRequestMethod& parameter during private key generation:
> it was used as a raw void* memory there. HttpRequestMethod is a non-POD
> type and has some "padding" bytes, which are not initialized by the
> constructor.
> 
> The patch simplifies private key generation by using a counter for this,
> which is sufficient to create a unique key within a single Squid process.
> Except fixing Valgrind errors, this solution saves many CPU cycles
> wasted on
> generating MD5 hashes just to "guarantee" uniqueness within a single
> process.
> 
> Regards,
> Eduard.
> 

How does this interact with objects that begin their life as private
then get converted to public keys?

* the comment about kidID and PID in the new private key blob as being
just an optimization I dont think is correct. Without them I think we
could have ID collisions in collapsed_forwarding, shared cache_mem, or
rock across workers. That would make them required for proper operations
in SMP.

Otherwise looks reasonable. How much testing has this had?

Amos



More information about the squid-dev mailing list