Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 675420 - cache is now cleared on every startup
: cache is now cleared on every startup
: regression
Product: Core
Classification: Components
Component: Networking: Cache (show other bugs)
: Trunk
: x86 Windows XP
: -- normal with 1 vote (vote)
: mozilla8
Assigned To: Michal Novotny (:michal)
: Patrick McManus [:mcmanus]
Depends on:
Blocks: 673808
  Show dependency treegraph
Reported: 2011-07-30 03:07 PDT by Jo Hermans
Modified: 2011-10-05 05:30 PDT (History)
13 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

troubleshooting information (1.82 KB, text/plain)
2011-07-30 03:09 PDT, Jo Hermans
no flags Details
Sample Bookmarks JSON file (17.11 KB, application/json)
2011-08-01 08:38 PDT, Alice0775 White
no flags Details
fix (1.75 KB, patch)
2011-08-02 08:57 PDT, Michal Novotny (:michal)
bzbarsky: review+
Details | Diff | Splinter Review

Description Jo Hermans 2011-07-30 03:07:53 PDT
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 <> and <>)
- 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 <>, 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 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 ?
Comment 1 Jo Hermans 2011-07-30 03:09:52 PDT
Created attachment 549561 [details]
troubleshooting information
Comment 2 Jo Hermans 2011-07-30 03:46:07 PDT
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.
Comment 3 Jo Hermans 2011-07-30 04:17:03 PDT
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 in the remaining tab
- go to 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 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 or
- 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.
Comment 4 Jo Hermans 2011-07-30 05:05:22 PDT
Note that if you set your homepage to a specific website (let's say <>, which is 11 entries and 200K), it will load that immediately at startup and thus clear the cache.
Comment 5 Sebastian Hengst [:aryx][:archaeopteryx] (needinfo if bug is intermittent) 2011-07-30 05:18:00 PDT
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 in a tab, use the second tab or open one to open
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 Alice0775 White 2011-08-01 08:38:48 PDT
Created attachment 549812 [details]
Sample Bookmarks JSON file

Confirmed on
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110801 Firefox/8.0a1 ID:20110801030916

I can reproduce with 100%.

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

Number of entries: 	0
Storage in use: 	0 KiB

These numbers should not be 0 like following.

Number of entries: 	591
Storage in use: 	5929 KiB

Regression window(m-c hourly)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110728 Firefox/8.0a1 ID:20110728141550
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110728 Firefox/8.0a1 ID:20110728154550

Triggered by:
dd7d71277a15	Michal Novotny — Bug 673808 - _CACHE_MAP_ is storing nsDiskCacheRecord structs with uninitialized data containing bits of Fx memory
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2011-08-01 10:58:55 PDT
I think we need to track this regression for 8.
Comment 8 Michal Novotny (:michal) 2011-08-02 08:57:31 PDT
Created attachment 550095 [details] [diff] [review]

This regression is caused by bug #673808. The cache is deleted because of the check at
Comment 9 Boris Zbarsky [:bz] (still a bit busy) 2011-08-02 09:11:03 PDT
Comment on attachment 550095 [details] [diff] [review]

Comment 10 Michal Novotny (:michal) 2011-08-02 15:26:15 PDT
Comment 11 Jo Hermans 2011-08-03 13:48:23 PDT
verified as fixed in :
Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110803 Firefox/8.0a1
Comment 12 Virgil Dicu [:virgil] [QA] 2011-10-05 04:29:07 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.