[squid-dev] [PATCH] Bug 4430 Squid crashes on shutdown while cleaning up idle ICAP connections.

Christos Tsantilas christos at chtsanti.net
Wed Mar 2 09:15:24 UTC 2016


On 03/01/2016 04:36 AM, Amos Jeffries wrote:
> On 1/03/2016 9:31 a.m., Christos Tsantilas wrote:
>> Hi all,
>>
>>    Squid crashes on shutdown with the following backtrace:
>> (gdb) bt
>> #0  0x00000000007138d8 in commSetConnTimeout(RefCount<Comm::Connection>
>> const&, int, RefCount<AsyncCall>&) ()
>> #1  0x0000000000510ddf in
>> commUnsetConnTimeout(RefCount<Comm::Connection> const&) ()
>> #2  0x00000000006104a4 in
>> IdleConnList::clearHandlers(RefCount<Comm::Connection> const&) ()
>> #3  0x000000000041226b in IdleConnList::closeN(unsigned long) ()
>> #4  0x0000000000412bf9 in IdleConnList::~IdleConnList() ()
>> #5  0x0000000000617e9b in Adaptation::Icap::ServiceRep::~ServiceRep() ()
>> #6  0x0000000000618579 in Adaptation::Icap::ServiceRep::~ServiceRep() ()
>> #7  0x000000000060e79c in Adaptation::DetachServices() ()
>> #8  0x0000000000606da0 in Adaptation::Config::freeService() ()
>> #9  0x0000000000606e4e in Adaptation::Config::~Config() ()
>> #10 0x001237f3e8664e29 in __run_exit_handlers (status=0,
>> listp=0x7f3e5c9cf5a8 <__exit_funcs>,
>>      run_list_atexit=run_list_atexit at entry=true) at exit.c:82
>>
>>
>> The global Adaptation::Icap::TheConfig object is automatically
>> destroyed when Squid exits. Its destructor destroys Icap::ServiceRep
>> objects that, in turn, close all open connections in the idle
>> connections pool. Since this happens after comm_exit has destroyed all
>> Comm structures associated with those connections, Squid crases.
>>
>> I am attaching two patches. A simple  patch
>> (Squid-Segfault-on-Shutdown-t2.patch) which I believe it should applied
>> to squid-3.5, but also I am posting a second preview patch
>> (Squid-Segfault-on-Shutdown-preview-trunk-t4.patch) with a possible long
>> term solution.
>>
>> I am suggesting to commit for now the squid3.5 patch while we are
>> discussing a long term solution for this or future similar problems for
>> trunk.
>>
>
> Okay. +1 on that 3.5 patch going in.

I applied the patch to squid-3.5 branch as r14000.

Probably we should apply it to trunk too, as a temporary solution, I 
have not opinion on this.


More information about the squid-dev mailing list