Closed Bug 167525 Opened 22 years ago Closed 22 years ago

When 1024 byte page is in cache, Error message "The file /test/ cannot be found. Please check the location and try again"

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: MozillaUser, Assigned: gordon)

References

()

Details

Attachments

(3 files)

Linux trunk build 2002090905 Load the url http://www.westcoastaerospace.com/test/ It will load just fine Now hit the reload button, or press back and then press forward, or hit enter in the URL bar, or perform any other action that causes the page to be reloaded. You will see the error message "The file /test/ cannot be found. Please check the location and try again" If you press Shift+Reload to bypass the cache, the page will reload just fine. If you go into preferences and clear your disk and memory caches, you will be able to reload the page again once. For similar symptoms see also: bug 141831 (same symptom, but with ftp) bug 123808 (marked worksforme after resolution of bug 149090) bug 155973 (same symptom as a result of deleting your cache dir) [Also, note that the links on http://www.westcoastaerospace.com/test/ are supposed to be broken. That index.html file is just one single file from a larger body of documentation on an internal server that I cannot make world-accessable.]
Confirmed on build 2002090408 on Mac OS 9 so Platform/OS --> All I can't see anything special with the HTTP-sniffer at http://webtools.mozilla.org/web-sniffer/ . I tried the same URL in Internet Explorer 5 and iCab, but it works ok.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
view source has the same problem Changing character coding also (Mac OS 9.1, Build 2002090608) Works with NS4
Tried with some older trunk versions (All WinME) 2002090904, 2002090404, 2002090208, 2002082804 all have the problem 1.1/20020826 works as expected
Aha! I think I have found something important. I was frustrated to find that adding or removing even a single letter of that index.html page caused the problem to go away (I was trying to correct the spelling of "Rebulding") and then I realized that this particular file is *exactly* 1024 bytes.
512 byte file http://www.westcoastaerospace.com/test/512.txt does not exhibit the problem.
neither does 2048 byte file http://www.westcoastaerospace.com/test/2048.txt Only 1024 byte files seem to have this problem. Amending summary.
Summary: Error message "The file /test/ cannot be found. Please check the location and try again" when page is in cache → When 1024 byte page is in cache, Error message "The file /test/ cannot be found. Please check the location and try again"
After seeing what seems like the same problem on a couple of real-life web pages (http://slashdot.org/index.pl, http://c2.com/cgi/quickChanges?days=2) I did a little more testing of various size files. I found that 4096 and 16384 byte files also have the same problem. The next value in sequence 65536 works fine as well as 8K and 32K. To reproduce the problem: 1) Click on attachment 2 [review]) Click on bookmark or enter new URL 3) Hit back button, see error message (Tested with build 2002091608 WinME)
Keywords: mozilla1.2
1k, 4k, and 16k are decision points in where to store cache entry data. It's not entirely surprising we break there. I bet we got the math comparisons wrong. If I'm right, it shouldn't be too hard to fix. Nice catch. Thanks.
The problem occurred when trying to write the cache blocks. The way the cache block count was calculated had an off by one bug in it, in relation to CalculateFileIndex().
Comment on attachment 102205 [details] [diff] [review] fix 1k, 4k, 16k boundary problem r=dougt. looks fine.
Attachment #102205 - Flags: review+
Comment on attachment 102205 [details] [diff] [review] fix 1k, 4k, 16k boundary problem sr=darin
Attachment #102205 - Flags: superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified fixed with linux trunk build 2002100911
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: