Re: cachemgr objects return internal server errors

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 12 Oct 2002 12:50:48 +0200

On Friday 11 October 2002 20.10, PsychoTekk .de wrote:
> hi all,
> i get 500's when trying to access "objects" or "vm_objects" in
> cachemanager. these are the apache error.log entries: [Thu Oct 10
> 17:38:51 2002] [error] [client 127.0.0.1] malformed header from
> script. Bad header= STORE_OK NOT_IN_MEMORY S:
> e:/apache/cgi-bin/cachemgr.cgi [Thu Oct 10 17:58:19 2002] [error]
> [client 127.0.0.1] malformed header from script. Bad
> header= STORE_OK IN_MEMORY S:
> e:/apache/cgi-bin/cachemgr.cgi
> "openfd_objects" just returns the GMTime stamp (the sourcecode
> contains no HTML). is this an error or is it just me?

I get this in HEAD, but not 2.5.

Seems to be a general clientSendMoreData() HEAD problem.. the correct
data gets into storeClientCallback() and passed into
clientSendMoreData(), but the datastream then gets messed up...

The culpit line seems to be 1422...

1419 if (buf != result.data) {
1420 /* we've got to copy some data */
1421 assert(result.length <= next->readBuffer.length);
1422 xmemcpy(buf, result.data, result.length);
1423 body_buf = buf;
1424 }

From what I can tell this overwrites the already received data with
the newly received data

result.data points at where storeClientCopy() asked the data to be
returned, which is in the middle of the next->readBuffer:

1536 /* TODO: copy into the supplied buffer */
1537 tempBuffer.offset = context->reqofs;
1538 tempBuffer.length = next->readBuffer.length -
context->reqofs;
1539 tempBuffer.data = next->readBuffer.data +
context->reqofs;
1540 storeClientCopy(context->sc, entry,
1541 tempBuffer, clientSendMoreData, context);
1542 return;

Data "packets" returned by the store (buffer address):

0x405a8030, length=17
"HTTP/1.0 200 OK\r\n"

0x405a8041, length=195
"Server: squid/2.6-DEVEL\r\nMime-Version: 1.0\r\nDate: Sat, 12 Oct
2002 10:31:12 GMT\r\nContent-Type: text/plain\r\nExpires: Sat, 12 Oct
2002 10:31:12 GMT\r\nLast-Modified: Sat, 12 Oct 2002 10:31:12
GMT\r\n\r\n"

0x405a8104, length=360
"KEY 48807C35B5A9C3D6E8CBB46EB179CD83\n\tGET
http://localhost:3128/squid-internal-static/icons/anthony-link.gif\n\tSTORE_OK
IN_MEMORY SWAPOUT_NONE PING_NONE
\n\tSPECIAL,CACHABLE,VALIDATED\n\tLV:1034"...

which looks good, but due to the copying above the previous packet is
forgotten so the full reply headers is never seen in the larger
buffer starting at 0x405a8030.

1484 rep = clientBuildReply(context, buf, size);

If I comment out the block starting at 1419 then everything seems to
work fine, but I am not sure if this has some other purpose...

Also, a explanation of the purpose of
context->flags.storelogiccomplete would be nice..

Regards
Henrik
Received on Sat Oct 12 2002 - 04:51:23 MDT

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