Re: Assertion Failure on Squid 2.2STABLE-3

From: Stephen R. van den Berg <srb@dont-contact.us>
Date: Thu, 1 Jul 1999 23:26:05 +0200

Ted_Rule@flextech.co.uk wrote:
>I've just had this little bit of excitement.

Not nearly as exciting as you would think :-).

>1999/07/01 13:51:35| assertion failed: client_side.c:1194: "size > 0"

I believe that I've fixed that problem in my snapshot already.
Beware, the text below is not an official patch, it's cut
and paste from my most recent snapshot diffs.

@@ -1179,5 +1217,5 @@ clientCacheHit(void *data, char *buf, ss
        debug(33, 3) ("clientCacheHit: request aborted\n");
        return;
- } else if (size < 0) {
+ } else if (size <= 0) {
        /* swap in failure */
        memFree(buf, MEM_CLIENT_SOCK_BUF);
@@ -1192,7 +1230,6 @@ clientCacheHit(void *data, char *buf, ss
        return;
     }
- assert(size > 0);
     mem = e->mem_obj;
     assert(!EBIT_TEST(e->flags, ENTRY_ABORTED));
     if (mem->reply->sline.status == 0) {
        /*

It seems like the check above forgets to check for zero. Once we check
for zero, the assertion becomes more or less useless (it's clear
that it's always true).

-- 
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg (AKA BuGless).
"ICMP: The protocol that goes PING!"
Received on Thu Jul 01 1999 - 15:14:07 MDT

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