cache is now cleared on every startup

VERIFIED FIXED in Firefox 8

Status

()

Core
Networking: Cache
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: Jo Hermans, Assigned: michal)

Tracking

({regression})

Trunk
mozilla8
x86
Windows XP
regression
Points:
---

Firefox Tracking Flags

(firefox8+ fixed)

Details

(Whiteboard: [qa!])

Attachments

(3 attachments)

(Reporter)

Description

6 years ago
Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110729 Firefox/8.0a1

I wanted to test out bug 670911 (the slow cache clearing bug), and for that I went to about:cache. After a few tests (surfing and deleting) I suddenly noticed that the cache was empty, even though I just had restarted the browser, and I knew there were a few megabytes in it (from an earlier look at about:cache before the restart).

So I tried to repeat it :

- create a completely new profile
- do not customize anything, sync with your older profile or whatever
- surf a few sites (I used <http://www.gva.be> and <http://www.demorgen.be>)
- note down the number of entries in about:cache
- also use the file explorer to look at your profile directory (in local settings). You can look at the size of the cache, but do not open the cache itself (as it will disappear soon)
- restart the browser (cleanly, I might add)
- since you're still using the default about:home homepage, nothing is loaded from the cache yet. You can verify with about:cache or the file explorer : it's still there.
- then go to a single website (I used <http://cnn.com>, that doesn't share anything with the above ones)
- if you now look at about:cache or file explorer, you'll see that the cache is almost empty, except for the site currently on the screen. In this case, I can see cnn.com and everything it loads (facebook, etc ...), but nothing from the old sites at all. 

If you make sure the cache contains more data (+1000 entries and +10MB data for instance), then it's easier to see that there was really a bunch of cache-file that were cleared.

At one test, I noticed the appearance of the Cache.Trash file at the very last step, proving that it was the browser that was deleting the data. Note that bug 670911 has made the process fast again, so you'll only see this with a cache that isn't clean (a few thousands of entries ???).

I do not see this behavior in Firefox 5.0. I have no Aurora installed here, but I'll try to see if it also contains the bug.

I do however suspect bug 670911, I could not remember a similar behavior from a week ago but I do not look all the time at about:cache). I know that the Cache is deleted when it's corrupt, how can it be in a new profile, with only a few visited sites ?
(Reporter)

Comment 1

6 years ago
Created attachment 549561 [details]
troubleshooting information
(Reporter)

Comment 2

6 years ago
from IRC:

12:05	Archaeopteryx	let me test with latest aurora
12:07	Archaeopteryx	searches for cache and start or cache and session didn't show any recent related bugs, so a new bug sounds appropriate
12:07	jhermans	the only bugs I can find in Bugzilla are from people that do not realize that auto-clearing at shutdown (pre- 4.0) can also clear the cache. Or that the cache is cleared when you shutdown the browser incorrectly (like ctrl-alt-del).
12:19	Archaeopteryx	latest aurora seems to be ok
12:24	Archaeopteryx	jhermans: i am wrong, this is also a problem in the latest aurora, but only with a new profile.

So if it's also in Aurora, it's not bug 670911 ?
I've also tested it again in Firefox 5.0 (with a new profile too), but I din't see it there.
(Reporter)

Comment 3

6 years ago
Hmmm ... personally I can only find the problem in Minefield, not in Aurora, Beta, Firefox 5.0 or Firefox 3.6.*. All versions were up-to-date (I downloaded Aurora and Beta first)

This is my exact steps what I did :

- cd to the directory where the version you want to test is installed
- firefox.exe -P -no-remote
- delete the profile 'test' (if it exists)
- create a new profile 'test'
- quit
- firefox.exe -P test -no-remote
- you get the warning about the default browser, untick the checkbox and click No
- you get 2 tabs, close the one on the left (welcome page)
- go to http://www.gva.be in the remaining tab
- go to http://www.demorgen.be in the same tab
- open a new tab and go to about:cache : the numbers should be smtg like 300 or 400 entries
- quit using the menubar
- firefox.exe -P test -no-remote
- go to http://cnn.com in the single tab
- open a new tab and go to about:cache : the numbers should now be smtg like 120 entries, if you closely, you see that there' no trace from gva.be or demorgen.be
- repeat for other browsers

In Aurora and older browsers, the number was smtg like 540 entries, which is the 3 websites combined. Minefield had its cache cleaned at the restart.
(Reporter)

Comment 4

6 years ago
Note that if you set your homepage to a specific website (let's say <http://www.google.be>, which is 11 entries and 200K), it will load that immediately at startup and thus clear the cache.
I see a problem of preserving the cache after profile creation on first shutdown of the profile in Firefox 5.0, latest beta, aurora and nightly on Windows XP SP 3 32-bit.
After creating the profile, disable default browser check and say no, dismiss the 'Know your rights' bar. Open http://www.mnenhy.de in a tab, use the second tab or open one to open http://www.heise.de.
Close Firefox using the window close button, confirm the multiple tabs close warning.
Start the profile again, call about:cache. Result: Nothing (0) in cache.
If you repeat to open the urls, close the browser and start again, you should now see something in the cache. With only one tab open, I can see the 0 cache entries problem more often.

Comment 6

6 years ago
Created attachment 549812 [details]
Sample Bookmarks JSON file

Confirmed on
http://hg.mozilla.org/mozilla-central/rev/f92e021f1f44
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110801 Firefox/8.0a1 ID:20110801030916

I can reproduce with 100%.

[STR]
1. Start Browser with new profile
2. Restart x 2 times (skip about:right and skip reporting statistics)
3. Restore attached Bookmarks(Ctrl + Shift + B > Import and Backup > Restore > Choose File...)
3. Restart Browser

4. Alt > Bookmarks > Right click on "New Folder" and Click "Open All in Tabs"
5. Focus 1st tab
6. Right click 1st tab and click "Close Other Tabs"
7. Reload tab and Check Disk cache usage

8. Quit Browser and Start Browser again
9. Open about:cache, Check Disk cache usage

[ACTUAL]
Number of entries: 	0
...
Storage in use: 	0 KiB
...


[EXPECTED]
These numbers should not be 0 like following.

Number of entries: 	591
...
Storage in use: 	5929 KiB
...


Regression window(m-c hourly)
Works:
http://hg.mozilla.org/mozilla-central/rev/6fd3e4c0082d
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110728 Firefox/8.0a1 ID:20110728141550
Fails:
http://hg.mozilla.org/mozilla-central/rev/dd7d71277a15
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110728 Firefox/8.0a1 ID:20110728154550
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6fd3e4c0082d&tochange=dd7d71277a15

Triggered by:
dd7d71277a15	Michal Novotny — Bug 673808 - _CACHE_MAP_ is storing nsDiskCacheRecord structs with uninitialized data containing bits of Fx memory

Updated

6 years ago
Blocks: 673808
Keywords: regression
(Assignee)

Updated

6 years ago
Assignee: nobody → michal.novotny
I think we need to track this regression for 8.
tracking-firefox8: --- → ?
(Assignee)

Comment 8

6 years ago
Created attachment 550095 [details] [diff] [review]
fix

This regression is caused by bug #673808. The cache is deleted because of the check at http://hg.mozilla.org/mozilla-central/annotate/982a5835fba1/netwerk/cache/nsDiskCacheMap.cpp#l152
Attachment #550095 - Flags: review?(bzbarsky)
Comment on attachment 550095 [details] [diff] [review]
fix

r=me
Attachment #550095 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 10

6 years ago
http://hg.mozilla.org/mozilla-central/rev/bd2c7e8f102e
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
(Reporter)

Comment 11

6 years ago
verified as fixed in :
Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110803 Firefox/8.0a1

Updated

6 years ago
status-firefox8: --- → fixed
tracking-firefox8: ? → +
Mozilla/5.0 (Windows NT 5.1; rv:10.0a1) Gecko/20111003 Firefox/10.0a1
Mozilla/5.0 (Windows NT 5.1; rv:9.0a2) Gecko/20111003 Firefox/9.0a2
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0

Verified in Firefox 8 Beta 1, Firefox 9 and Firefox 10 on Ubuntu 11.04, Windows XP, Windows 7, Mac OS 10.6 using the STR in comment 6. The cache is no longer cleared.
Status: RESOLVED → VERIFIED
Whiteboard: [qa!]
You need to log in before you can comment on or make changes to this bug.