Re: - Squid coredump in: ipcache_dnsHandleRead -

From: Duane Wessels <>
Date: Thu, 16 Jan 97 14:46:52 -0800

Kurt_Knochner@GeNUA.DE writes:

>Hi Squid Gurus.
>I'm running squid-1.1.2 on a BSDI 2.1 System. Unfortunately squid dies
>from time to time. I can't figure out why this happens. I appended the
>output of a gdb stack backtrace. The sourcecode which produces the core
>dump is:
> if (i->status != IP_DISPATCHED)
> fatal_dump("ipcache_dnsHandleRead: bad status");
>What does IP_DISPATCHED mean?
>Used Hardware:
> Pentium 133
> Memory: 64 MB
> PCI-Bus
> SCSI Controller NCR 810
>Does anyone know what's going wrong ?
>(gdb) where
>#0 0x55df9 in kill ()
>#1 0x55357 in abort ()
>#2 0x339ae in fatal_dump (message=0x1ca15 "ipcache_dnsHandleRead: bad status"
> at tools.c:383
>#3 0x1cb55 in ipcache_dnsHandleRead (fd=5, dnsData=0x14f5c0) at ipcache.c:590
>#4 0x9c31 in comm_select (sec=1) at comm.c:1033
>#5 0x1f65e in main (argc=4, argv=0xefbfde6c) at main.c:686

I feel like I should explain this bug...

Last month I was watching the NLANR Cache 'vitals' and noticed that one
of the caches had quickly used up a thousand file descriptors. It was
strange because all the others looked normal. Eventually I learned
that it was full of pending requests to ''. There
were a thousand requests waiting for a DNS lookup on!

It seemed that the lookup had been pending since
around midnight, when we rotate the logs and HUP the process. Since
all the dnsservers had been restarted, there was never going to be any
data coming back to bring out of the IP_DISPATCHED
state. Bad news...

So I added a check for DNS requests which spend too long in the
IP_DISPATCHED state. Unfortunately I haven't gotten it working just
right yet. There have been coredump reports for this bug in version
1.1.2 through 1.1.4. What seems to be happening is that the bad IP
cache entry gets released (i.e. freed) and then something comes back
from the dnsserver. The 'dnsData' contains a pointer to the 'ipcache'
which has been free. The fatal_dump occurs because 'ipcache->status'
is bogus.

Duane W.
Received on Thu Jan 16 1997 - 15:01:26 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:06 MST