Re: bugs in HEAD

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 8 May 2002 12:59:46 +0200

Hmm.. the trace seems to suggest the error is in cache digests.. but cache
digests take place regardless of no-query.. so I am a bit confused.. if it
was digests then one would think the error should always occur..

To try to isolate this please first try with no-digest-exchanges, then if it
does not make a difference, recompile Squid without cache digest support.

The fact that c prints out as NULL is most likely a gdb optimization ghost
(gdb being confused by gcc).. "0xdf5f0018 - some small amount" is defnitely
not NULL..

What I think most likely has happened here is that cbdataReferenceValid has
been called for a non-cbdata pointer. This will make cbdata quite upset and
abort in the CBDATA_CHECK macro.

To make debugging easier (variables and linenumbers always correct)
recompile without optimization.

Regards
Henrik

Andres Kroonmaa wrote:
> cache_peer cache1 parent 80 3130 round-robin no-delay weight=30
> cache_peer cache1 parent 80 3130 round-robin no-query no-delay
> weight=30
>
> adding "no-query" option to a peer causes squid to crash on first
> request.
>
> I'm having trouble to chase this, but it seems to have appeared
> with the last bigger flood of merges into HEAD.
>
> Program received signal SIGABRT, Aborted.
> 0xdfbd7cc0 in _libc_kill () from /usr/lib/libc.so.1
> (gdb) bt
> #0 0xdfbd7cc0 in _libc_kill () from /usr/lib/libc.so.1
> #1 0xdfb9b81e in raise () from /usr/lib/libc.so.1
> #2 0xdfb8bc60 in abort () from /usr/lib/libc.so.1
> #3 0x8069655 in xassert () at debug.c:270
> #4 0x805e587 in cbdataReferenceValid (p=0xdf5f0018) at cbdata.c:269
> #5 0x8093c39 in peerDigestFetchedEnough (fetch=0xdf5f0018,
> buf=0xdf5f0054 "HTTP/1.0 200 OK\r\nServer:
> Squid/2.5-DEVEL\r\nMime-Version: 1.0\r\nDate: Wed, 08 May 2002 09:34:04
> GMT\r\nContent-Type: application/cache-digest\r\nContent-Length:
> 506045\r\nExpires: Wed, 08 May 2002 10:04:04 GMT"..., size=1448,
> step_name=0x80e394e "peerDigestHandleReply") at peer_digest.c:621 #6
> 0x80932da in peerDigestHandleReply (data=0xdf5f0018,
> buf=0xdf5f0054 "HTTP/1.0 200 OK\r\nServer:
> Squid/2.5-DEVEL\r\nMime-Version: 1.0\r\nDate: Wed, 08 May 2002 09:34:04
> GMT\r\nContent-Type: application/cache-digest\r\nContent-Length:
> 506045\r\nExpires: Wed, 08 May 2002 10:04:04 GMT"..., copysize=1448) at
> peer_digest.c:363
> #7 0x80a55d4 in storeClientCallback (sc=0x84cd088, sz=1448) at
> store_client.c:151 #8 0x80a58fc in storeClientCopy2 (e=0xdf5305a8,
> sc=0x84cd088) at store_client.c:261 #9 0x80a65dd in InvokeHandlers
> (e=0xdf5305a8) at store_client.c:601 #10 0x80a31b9 in storeAppend
> (e=0xdf5305a8,
> buf=0x812d280 "HTTP/1.0 200 OK\r\nServer:
> Squid/2.5-DEVEL\r\nMime-Version: 1.0\r\nDate: Wed, 08 May 2002 09:34:04
> GMT\r\nContent-Type: application/cache-digest\r\nContent-Length:
> 506045\r\nExpires: Wed, 08 May 2002 10:04:04 GMT"..., len=1448) at
> store.c:529 #11 0x807d9fb in httpReadReply (fd=27, data=0x85144a4) at
> http.c:642 #12 0x8068686 in comm_select (msec=10) at comm_poll.c:510
> #13 0x808b854 in main (argc=4, argv=0x8047a20) at main.c:722
>
> (gdb) frame 4
> #4 0x805e587 in cbdataReferenceValid (p=0xdf5f0018) at cbdata.c:269
> 269 }
> (gdb) l
> (gdb) l 264
> 259 cbdataReferenceValid(const void *p)
> 260 {
> 261 cbdata *c;
> 262 if (p == NULL)
> 263 return 1; /* A NULL pointer cannot become
> invalid */ 264 debug(45, 3) ("cbdataReferenceValid: %p\n", p);
> 265 c = (cbdata *) (((char *) p) - OFFSET_OF(cbdata, data));
> 266 CBDATA_CHECK(c);
> 267 assert(c->locks > 0);
> 268 return c->valid;
> (gdb) p c
> $3 = (cbdata *) 0x0
>
> (gdb) up
> #5 0x8093c39 in peerDigestFetchedEnough (fetch=0xdf5f0018,
> buf=0xdf5f0054 "HTTP/1.0 200 OK\r\nServer:
> Squid/2.5-DEVEL\r\nMime-Version: 1.0\r\nDate: Wed, 08 May 2002 09:34:04
> GMT\r\nContent-Type: application/cache-digest\r\nContent-Length:
> 506045\r\nExpires: Wed, 08 May 2002 10:04:04 GMT"..., size=1448,
> step_name=0x80e394e "peerDigestHandleReply") at peer_digest.c:621 621
> const int fcb_valid = cbdataReferenceValid(fetch);
>
> (gdb) p *fetch
> $4 = {pd = 0x82aee88, entry = 0xdf5305a8, old_entry = 0x0, sc = 0x84cd088,
> old_sc = 0x0, request = 0x84b9d74, offset = 0, mask_offset = 0, start_time
> = 1020851714, resp_time = 0, expires = 0, sent = {msg = 0, bytes = 0}, recv
> = {msg = 0, bytes = 0}, buf = "HTTP/1.0 200 OK\r\nServer:
> Squid/2.5-DEVEL\r\nMime-Version: 1.0\r\nDate: Wed, 08 May 2002 09:34:04
> GMT\r\nContent-Type: application/cache- digest\r\nContent-Length:
> 506045\r\nExpires: Wed, 08 May 2002 10:04:04 GMT"..., bufofs = 1448, state
> = DIGEST_READ_REPLY}
> (gdb)
>
> (gdb) p *fetch->entry
> $5 = {hash = {key = 0xdf4e01e8, next = 0x0}, mem_obj = 0x84b0390, repl =
> {data = 0x0}, timestamp = 1020850444, lastref = 1020851714, expires =
> 1020852244, lastmod = 1020850444, swap_file_sz = 0, refcount = 1, flags =
> 1120, swap_filen = -1, swap_dirn = -1, lock_count = 3, mem_status = 0,
> ping_status = 2, store_status = 1, swap_status = 0} (gdb) p
> *fetch->entry->mem_obj
> $6 = {method = 1, url = 0x8514300
> "http://cache1.online.ee/squid-internal-periodic/store_digest", data_hdr =
> {head = 0xdf4c60b8, tail = 0xdf4c60b8, origin_offset = 0}, inmem_hi = 1448,
> inmem_lo = 0, clients = {head = 0x84cd0b4, tail = 0x84cd0b4}, nclients = 1,
> swapout = {queue_offset = 0, memnode = 0x0, sio = 0x0}, reply = 0x84b4398,
> request = 0x84b9d74, start_ping = { tv_sec = 0, tv_usec = 0},
> ping_reply_callback = 0, ircb_data = 0x0, fd = -1, abort = {callback =
> 0x8071180 <fwdAbort>, data = 0x84d1078}, log_url = 0x8514348
> "http://cache1.online.ee/squid-internal-periodic/store_digest", repl =
> {data = 0x0}, id = 35, object_sz = -1, swap_hdr_sz = 0, vary_headers = 0x0}
> (gdb)
>
>
> ------------------------------------
> Andres Kroonmaa <andre@online.ee>
> CTO, Microlink Online
> Tel: 6501 731, Fax: 6501 725
> Pärnu mnt. 158, Tallinn,
> 11317 Estonia
Received on Wed May 08 2002 - 04:59:58 MDT

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