[squid-dev] [PATCH] tentative fix for bug 4438

Alex Rousskov rousskov at measurement-factory.com
Sat Mar 5 21:21:06 UTC 2016


On 03/05/2016 04:31 AM, Kinkie wrote:
> ensuring that mempools are initialized before MemBlob is
> used.

Please explain how

  * a call to Mem::Init()

at some random time during dynamic initialization[1] would _ensure_ that
Mem::Init() is called before

  * MemBlob is used.

I see no dependency or guaranteed order between the two bulleted events
above but perhaps it is hidden in the code that is not a part of the
proposed patch.

[1] http://en.cppreference.com/w/cpp/language/initialization


Thank you,

Alex.
P.S. You do not need a declare a whole class to call a function during
static initialization. Use a coma operator to produce a non-void result
if needed. This is unrelated to the primary question I am asking above.

P.P.S. IIRC, some compilers will complain about unused static variable
"mi". You may [move and] UseThisStatic() to avoid this problem. This is
unrelated to the primary question I am asking above.

P.P.P.S. Please note that whether your patch helps Yuri is irrelevant
for the long-term fix. If the bug is a usage/initialization race, then
it may appear to be fixed when you reshuffle random events, but it will
happen again unless properly fixed.



More information about the squid-dev mailing list