[squid-users] Reproduce squid file corruption in 3 easy steps

From: Phil Oester <kernel@dont-contact.us>
Date: Fri, 4 Oct 2002 13:17:57 -0700

This is a followup to my email yesterday regarding corrupted files. Since my example was perhaps overly complicated, decided to come up with a simple, easily reproduced example.

On host A (running apache 1.3.26):
1) create a 5mb file of zeros (intentionally above the 4mb maximum_object_size)
        dd if=/dev/zero of=5megzeros bs=1024 count=5000

On host B
2) create identical file with name 5megzeros_original
        dd if=/dev/zero of=5megzeros_original bs=1024 count=5000

3) retrieve file from host A using squid farm (3 x 2.5 stable 1) until corruption found
        while ((1)) ; do http_proxy=x.x.x.x:3128 wget -nv --proxy=on http://x.x.x.x/5megzeros ; diff 5megzeros 5megzeros_original || mv 5megzeros bad.$$ ; rm -f 5megzeros ; done

now, sit back and wait:

12:48:51 URL:http://x.x.x.x/5megzeros [5120000/5120000] -> "5megzeros" [1]
12:48:54 URL:http://x.x.x.x/5megzeros [5120000/5120000] -> "5megzeros" [1]
12:48:57 URL:http://x.x.x.x/5megzeros [5120000/5120000] -> "5megzeros" [1]
12:48:59 URL:http://x.x.x.x/5megzeros [5120000/5120000] -> "5megzeros" [1]
12:49:02 URL:http://x.x.x.x/5megzeros [5120000/5120000] -> "5megzeros" [1]
Binary files 5megzeros and 5megzeros_original differ

AHA! Something different - let's take a peek:

vi bad.13942, search for http:

http://www.lobsterfest.com/assets/images/autogen/lobcook_HbuttonDBLredbrdr.gif^@^HHTTP/1.1 200 OK^M
Server: Microsoft-IIS/5.0^M
Connection: keep-alive^M
Date: Tue, 10 Sep 2002 20:19:39 GMT^M
Content-Type: image/gif^M
Accept-Ranges: bytes^M
Last-Modified: Wed, 31 Jul 2002 06:55:51 GMT^M
ETag: "7445d34e5f38c21:bd2"^M
Content-Length: 1950^M

While a lobsterfest does sound appealing, it's definitely not nulls as you'd expect!

Ideas, comments, criticism???

-Phil Oester
Received on Fri Oct 04 2002 - 14:18:01 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:10:36 MST