Squid Parent: Squid is abort due to assert failed in comm_write
Environment
- Red Hat Enterprise Linux 6
- squid-3.1.10-16.el6.x86_64
Issue
- Squid Parent: Squid is abort due to assert failed in comm_write
Aug 14 13:55:35 hostname1 abrt[12653]: saved core dump of pid 16081 (/usr/sbin/squid) to /var/spool/abrt/ccpp-2013-08-14-13:55:26-16081.new/coredump (765808640 bytes)
Aug 14 13:55:35 hostname1 abrtd: Directory 'ccpp-2013-08-14-13:55:26-16081' creation detected
Aug 14 13:55:35 hostname1 abrt[12653]: /var/spool/abrt is 1543246699 bytes (more than 1279 MB), deleting 'ccpp-2013-07-24-08:43:46-20846'
Aug 14 13:55:35 hostname1 abrtd: Size of '/var/spool/abrt' >= 1000 MB, deleting 'ccpp-2013-07-24-08:43:46-20846'
Aug 14 13:55:35 hostname1 abrtd: Lock file '/var/spool/abrt/ccpp-2013-07-24-08:43:46-20846/.lock' is locked by process 12653
Aug 14 13:55:36 hostname1 abrtd: Lock file '/var/spool/abrt/ccpp-2013-07-24-08:43:46-20846/.lock' is locked by process 12653
Aug 14 13:55:36 hostname1 squid[5834]: Squid Parent: child process 16081 exited due to signal 6 with status 0
Aug 14 13:55:36 hostname1 abrtd: '/var/spool/abrt/ccpp-2013-07-24-08:43:46-20846' does not exist
Aug 14 13:55:39 hostname1 squid[5834]: Squid Parent: child process 12727 started
Resolution
- This issue is fixed with squid-3.1.10-29.el6 .
- proposed patch
diff -rupN squid-3.1.10/src/comm.cc.old squid-3.1.10/src/comm.cc
--- squid-3.1.10/src/comm.cc.old 2013-08-18 00:13:01.555210473 +0530
+++ squid-3.1.10/src/comm.cc 2013-08-18 00:11:07.946310873 +0530
@@ -2060,8 +2060,10 @@ comm_write(int fd, const char *buf, int
debugs(5, 5, "comm_write: FD " << fd << ": sz " << size << ": asynCall " << callback);
/* Make sure we are open, not closing, and not writing */
- assert(isOpen(fd));
- assert(!fd_table[fd].closing());
+ if(!isOpen(fd) || fd_table[fd].closing()) {
+ return;
+ }
+
comm_io_callback_t *ccb = COMMIO_FD_WRITECB(fd);
assert(!ccb->active());
Root Cause
- It is a abort. The FD is already marked for cleanup.
- fd_table[fd].closing() is true and trying to do a write on the fd and assert is failing.
Diagnostic Steps
# gdb squid coredump
(snipped)
Core was generated by `(squid) -f /etc/squid/squid.conf'.
Program terminated with signal 6, Aborted.
#0 0x00007f2a4c2be885 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0 0x00007f2a4c2be885 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007f2a4c2c0065 in abort () at abort.c:92
#2 0x00007f2a4eada8c5 in xassert (msg=0x7f2a4ec52a2d "!fd_table[fd].closing()", file=<value optimized out>, line=2064) at debug.cc:556
#3 0x00007f2a4eb9a248 in comm_write (fd=31, buf=0x7f2a6b6a1e40 "", size=38, callback=..., free_func=0x7f2a4eb3d380 <memFree2K(void*)>) at comm.cc:2064
#4 0x00007f2a4eb9a4b6 in comm_write (fd=31, buf=0x7f2a6b6a1e40 "", size=38, handler=<value optimized out>, handler_data=<value optimized out>,
free_func=0x7f2a4eb3d380 <memFree2K(void*)>) at comm.cc:2054
#5 0x00007f2a4eae67c2 in idnsDoSendQueryVC (vc=0x7f2a62400618) at dns_internal.cc:703
#6 0x00007f2a4eae8191 in idnsSendQueryVC (q=0x7f2a607ad978) at dns_internal.cc:805
#7 idnsSendQuery (q=0x7f2a607ad978) at dns_internal.cc:832
#8 0x00007f2a4eae9104 in idnsGrokReply (buf=<value optimized out>, sz=<value optimized out>) at dns_internal.cc:995
#9 0x00007f2a4eaea4d2 in idnsRead (fd=7, data=<value optimized out>) at dns_internal.cc:1214
#10 0x00007f2a4ead8e26 in comm_select (msec=<value optimized out>) at comm_epoll.cc:307
#11 0x00007f2a4eb98b2e in CommSelectEngine::checkEvents (this=<value optimized out>, timeout=<value optimized out>) at comm.cc:2683
#12 0x00007f2a4eaeeec4 in EventLoop::checkEngine (this=0x7fffc2bd2fd0, engine=0x7fffc2bd3040, primary=<value optimized out>) at EventLoop.cc:50
#13 0x00007f2a4eaef03d in EventLoop::runOnce (this=0x7fffc2bd2fd0) at EventLoop.cc:124
#14 0x00007f2a4eaef128 in EventLoop::run (this=0x7fffc2bd2fd0) at EventLoop.cc:94
#15 0x00007f2a4eb3cc05 in SquidMain (argc=<value optimized out>, argv=<value optimized out>) at main.cc:1399
#16 0x00007f2a4eb3d1d6 in SquidMainSafe (argc=<value optimized out>, argv=<value optimized out>) at main.cc:1159
#17 main (argc=<value optimized out>, argv=<value optimized out>) at main.cc:1151
gdb) f 3
#3 0x00007f2a4eb9a248 in comm_write (fd=31, buf=0x7f2a6b6a1e40 "", size=38, callback=..., free_func=0x7f2a4eb3d380 <memFree2K(void*)>) at comm.cc:2064
2064
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
