[wessels@squid-cache.org: Re: Reading 0 bytes in clientReadRequest]

From: Adrian Chadd <adrian@dont-contact.us>
Date: Wed, 14 Mar 2001 02:59:22 +0800

Just FYI..

Adrian

----- Forwarded message from Duane Wessels <wessels@squid-cache.org> -----

Date: Tue, 13 Mar 2001 10:37:24 -0700 (MST)
From: Duane Wessels <wessels@squid-cache.org>
To: "Vladimir B. Savkin" <savkin@shade.msu.ru>
cc: squid-bugs@squid-cache.org
Subject: Re: Reading 0 bytes in clientReadRequest

yeah, looks broken. The conn->in.buf buffer is supposed to
be grown later in this function, around line 2830. But that
line is contained inside this while block:

   2665 while (conn->in.offset > 0 && conn->body.size_left == 0) {

The while statement is not true in your case, so the buffer never
grows.

Duane W.

On Tue, 13 Mar 2001, Vladimir B. Savkin wrote:
 
> Investigating why Squid sometimes starts to consume 100% CPU time I added
> some debugging code I found the following:
>
> <SCREENSHOT>
> (gdb) step
> clientReadRequest (fd=39, data=0x90f10b8) at client_side.c:2597
> 2597 int parser_return_code = 0;
> (gdb) list
> 2592
> 2593 static void
> 2594 clientReadRequest(int fd, void *data)
> 2595 {
> 2596 ConnStateData *conn = data;
> 2597 int parser_return_code = 0;
> 2598 int k;
> 2599 request_t *request = NULL;
> 2600 int size;
> 2601 void *p;
> (gdb) print *conn
> $10 = {fd = 39, in = {
> buf = 0x90f1160 "scheme=black&attack=on&damage=on&speech=on&majmsg=on&minmsg=on&hurted=on&underl=on&extras=on&nukecc=on&output=document&text=%3C277hp+647m+351mv%3E+Invoker%27s+Guild%0D%0A+%0D%0A%5BExits%3A+west+up%5D%"...,
> offset = 4095, size = 4096}, body = {size_left = 5903, request = 0x0,
> buf = 0x0, bufsize = 0, callback = 0, cbdata = 0x0},
> auth_type = AUTH_UNKNOWN, auth_user_request = 0x0, chr = 0x89a7078, peer = {
> sin_family = 2, sin_port = 52632, sin_addr = {s_addr = 34449600},
> sin_zero = "\016°LÏ\177è\023À"}, me = {sin_family = 2, sin_port = 14348,
> sin_addr = {s_addr = 118335680}, sin_zero = "\016°LÏ\177è\023À"},
> log_addr = {s_addr = 34449600}, rfc931 = '\000' <repeats 63 times>,
> nrequests = 1, defer = {n = 0, until = 0}}
> (gdb) step
> 2605 char *prefix = NULL;
> (gdb) step
> 2607 fde *F = &fd_table[fd];
> (gdb) step
> 2608 int len = conn->in.size - conn->in.offset - 1;
> (gdb) step
> 2609 debug(33, 4) ("clientReadRequest: FD %d: reading request...\n", fd);
> (gdb) print len
> $11 = 0
> (gdb) print *F
> $12 = {type = 3, local_port = 3128, remote_port = 39117,
> ipaddr = "192.168.13.2\000\000\000",
> desc = "http://carrion.gameshadow.com/cgi-box/logformat.pl", '\000' <repeats 13 times>, flags = {open = 1, close_request = 0, write_daemon = 0, closing = 0,
> socket_eof = 0, nolinger = 0, nonblocking = 1, ipc = 0,
> called_connect = 0}, bytes_read = 4499, bytes_written = 0, uses = 0,
> disk = {wrt_handle = 0, wrt_handle_data = 0x0, write_q = 0x0,
> write_q_tail = 0x0, offset = 0}, read_handler = 0, read_data = 0x90f10b8,
> write_handler = 0, write_data = 0x0,
> timeout_handler = 0x805fa60 <clientLifetimeTimeout>, timeout = 984504745,
> timeout_data = 0x89a7078, lifetime_data = 0x0, close_handler = 0x9454c10,
> defer_check = 0x805eba0 <clientReadDefer>, defer_data = 0x90f10b8,
> rwstate = 0x0}
> </SCREENSHOT>
>
> Client 193.232.13.2 is a downstream proxy.
>
> I track CVS HEAD revision of Squid and use Linux 2.4.2-ac1.
>
> Do I need to provide additional info?
> It usually takes several hours before it happens.
>
>
> :wq
> With best regards,
> Vladimir Savkin.
>
>

----- End forwarded message -----

-- 
Adrian Chadd		"The fact you can download a 100 megabyte file
<adrian@creative.net.au>  from half way around the world should be viewed
			    as an accident and not a right."
					-- Adrian Chadd and Bill Fumerola
Received on Tue Mar 13 2001 - 11:59:29 MST

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