Re: bugs in HEAD

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 8 May 2002 18:14:11 +0200

Andres Kroonmaa wrote:

> I see that event peerDigestCheck is not registered at startup. I wonder
> why. Looks like digests from peers are not fetched unless some client
> requests is seen.

Probably correct. This is the spirit of many things in Squid to avoid wasting
extra bandwidth unless there is at least some traffic..

> With added no-digest it doesn't crash.

Good. Then we know within reasonable doubt that the problem is isolated to
the digest exchanges.

> I'm very unfamiliar with this code, but to me is seems that right pointer
> is passed, but that pointer is not cbdatalocked.

Also a possibility. I could not tell from your trace which of the two asserts
that was triggered (you did not send the assertion error, only a stacktrace
where gdb was confused on linenumbers etc..)

> cvs/HEAD/src>egrep fetch.+cbd *.c
> peer_digest.c: fetch = cbdataAlloc(DigestFetchState);
> peer_digest.c: fetch->pd = cbdataReference(pd);
> peer_digest.c: * must be called only when fetch and pd cbdata are valid */
> peer_digest.c: * must be called only when fetch cbdata is valid */
>
> cvs/HEAD/src>egrep cbd.+fetch *.c
> peer_digest.c: cbdataInternalLock(fetch);
> peer_digest.c: if (cbdataReferenceValid(fetch)) {
> peer_digest.c: cbdataInternalUnlock(fetch);
> peer_digest.c: const int fcb_valid = cbdataReferenceValid(fetch);
> peer_digest.c: const int pdcb_valid = fcb_valid &&
> cbdataReferenceValid(fetch->pd); peer_digest.c: const int pcb_valid =
> pdcb_valid && cbdataReferenceValid(fetch->pd->peer); peer_digest.c:
> cbdataReferenceDone(fetch->pd);
> peer_digest.c: cbdataFree(fetch);
>
> I get impression that cbdataInternalLock(fetch) is used in some func to
> avoid such assert faults. but on this specific case fetch has zero locks
> on it.
> I'm still not qualified to do anything about it, so I'd rather
> ask you to look into it or file a bug report.

File a bug report in bugzilla for now and have digests disabled until the
problem can be fixed.

Need to review once again how the peer digest exchange abuses cbdata. I don't
remember offhand why there was need to manually lock the pointer. Normally
when using cbdata one rarely if ever needs to manually lock the structure, or
have calls to both cbdataAlloc/Free and cbdataReference in the same .c file..

Regards
Henrik
Received on Wed May 08 2002 - 10:14:15 MDT

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