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

Christos Tsantilas christos at chtsanti.net
Mon Feb 29 20:31:05 UTC 2016


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.

Regards,
    Christos

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Squid-Segfault-on-Shutdown-t2.patch
Type: text/x-patch
Size: 1607 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160229/b4d9fe39/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Squid-Segfault-on-Shutdown-preview-trunk-t4.patch
Type: text/x-patch
Size: 25332 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160229/b4d9fe39/attachment-0003.bin>


More information about the squid-dev mailing list