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

Eduard Bagdasaryan eduard.bagdasaryan at measurement-factory.com
Wed Jun 8 12:52:48 UTC 2016


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160608/7964ded0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-196-uninitialised-value-when-loading-icons-t1.patch
Type: text/x-patch
Size: 7522 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160608/7964ded0/attachment.bin>


More information about the squid-dev mailing list