Re: /bzr/squid3/trunk/ r11499: Upgrade comm layer Connection handling

From: Tsantilas Christos <chtsanti_at_users.sourceforge.net>
Date: Sat, 18 Jun 2011 14:13:33 +0300

Hi all,
   After last commits the ICAP client can not be used, the squid crashes
when trying to open a connection to the ICAP server.

Looking in the code I found that the problem exist inside the
Adaptation::Icap::ServiceRep::getConnection method. The new code is not
exactly equivalent with the old code.

The old code return always a fd to the user. In the case no connection
found in idle connections, it uses the comm_open to reserve an fd.

The current code, if I am correct, in the case no connection found in
idle list it just uses a
  connection = new Comm::Connection;
which just creates a Comm::Connection object with fd=-1. This is causes
a crash later in Xaction::openConnection.

I believe some code is missing here, but I am not sure if it should be
added in comm/Connection.* (maybe a second constructor which allocates
an fd) or in ServiceRep::getConnection function.

backtrace is :
Program received signal SIGABRT, Aborted.
0x00007ffff5a22a75 in *__GI_raise (sig=<value optimized out>)
     at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
         in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) backtrace
#0 0x00007ffff5a22a75 in *__GI_raise (sig=<value optimized out>)
     at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff5a265c0 in *__GI_abort () at abort.c:92
#2 0x0000000000511015 in xassert (msg=0x26b7 <Address 0x26b7 out of
bounds>,
     file=0xecc910 "\230\336\326\365\377\177", line=749) at debug.cc:567
#3 0x0000000000608150 in commSetTimeout (fd=-1, timeout=30, callback=...)
     at comm.cc:749
#4 0x000000000069c51c in Adaptation::Icap::Xaction::openConnection (
     this=0xeaba18) at Xaction.cc:137
#5 0x0000000000605014 in JobDialer<AsyncJob>::dial(AsyncCall&) ()
#6 0x0000000000602969 in AsyncCall::make (this=0xeac680) at AsyncCall.cc:36
#7 0x00000000006055ab in AsyncCallQueue::fireNext (this=<value
optimized out>)
     at AsyncCallQueue.cc:54
#8 0x0000000000605740 in AsyncCallQueue::fire (this=0xb4a340)
     at AsyncCallQueue.cc:40
#9 0x000000000051ec2c in EventLoop::runOnce (this=0x7fffffffe060)
     at EventLoop.cc:131
#10 0x000000000051ed08 in EventLoop::run (this=0x7fffffffe060)
     at EventLoop.cc:95
#11 0x0000000000578305 in SquidMain (argc=<value optimized out>,
     argv=0x7fffffffe228) at main.cc:1506
#12 0x0000000000578b06 in SquidMainSafe (argc=9911, argv=0x26b7)
     at main.cc:1239
Received on Sat Jun 18 2011 - 11:13:56 MDT

This archive was generated by hypermail 2.2.0 : Sun Jun 19 2011 - 12:00:05 MDT