MozillaZine

cookies.sqlite-shm & cookies.sqlite-wal?

Discussion of general topics about Mozilla Firefox
Anonymosity
 
Posts: 8499
Joined: May 7th, 2007, 12:07 pm

Post Posted August 19th, 2011, 10:56 am

While Firefox 6 is running, there are two extra cookies files in the profile: cookies.sqlite-shm and cookies.sqlite-wal. These disappear when Firefox closes. What do they do?

KWierso
 
Posts: 8831
Joined: May 7th, 2006, 10:29 pm
Location: California

Post Posted August 19th, 2011, 11:00 am

They are used in-session only to help with handling the cookies.sqlite database file, I think.

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 19th, 2011, 4:10 pm

It's a database journal. They have a similar function and use to filesystem journals.

http://en.wikipedia.org/wiki/Journaling_file_system
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Anonymosity
 
Posts: 8499
Joined: May 7th, 2007, 12:07 pm

Post Posted August 19th, 2011, 5:23 pm

OK. Thanks.

Grumpus

User avatar
 
Posts: 11907
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted August 20th, 2011, 7:13 pm

This should explain the sqlite-wal part of it a little.
Write ahead logging

vasa1
 
Posts: 604
Joined: December 24th, 2010, 5:32 am

Post Posted August 20th, 2011, 7:56 pm

I had made a post some time ago regarding the files present in a typical profile. But ...

Grumpus

User avatar
 
Posts: 11907
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted August 20th, 2011, 8:17 pm

@Vasa1 - you are right we've had this discussion before with little resolution.

So far I've found no ill effects erasing these files, frankly I don't really like the whole sqlite concept.
I disliked it with earlier version of FF where it created a sqlite-journal, which it still seems to do for cookies, places, extensions or other files.
It's as if something is editing files or accumulations which I would rather not have edited in preparation for addition. The cookies adjunct files are especially troubling since I am not accepting cookies, so why are these files being created?
Not accepting cookies means nothing is added, so why write ahead or management of something not supposedly open to change?
It's not something which is created at all sites on the Internet, it seems to be affected by something at particular sites.

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 20th, 2011, 8:46 pm

Since the places.sqlite and cookies.sqlite are typically high-IO databases, it's probably set-up to automatically create the journal files when the database is opened. And they are opened in the start-up/page-load process.

To test, I created a new profile, opened Firefox and set it to not accept cookies, then quit. I then restarted it by opening about:blank from the command line. Sure enough, the shm/wal files were created for places.sqlite and cookies.sqlite once I visited a site. However, no data was written to any of the coolies.* files.

And these files should automatically be cleaned up after closing Firefox. If they aren't, deleting them could potentially delete information that hasn't actually been written to the database. And given that these are very small files, I see no benefit in deleting them.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Grumpus

User avatar
 
Posts: 11907
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted August 21st, 2011, 5:09 pm

I considered there may have been some form of writing going on to these files and holding the changes noted until such time they could be added or managed for places or cookies, same for the one created for extensions.
With tracking off, all downloads set to manual, automatic updates off and cookies off there should be no record of changes unless it was an unrequested transfer of some form. Deleting them may be something to consider.
Sizes are not so small.
Looking at cookies.sqlite-shm = 32Kb and wal at 96.1Kb ; places.sqlite-shm = 32Kb but the wal = 571Kb. Thats a pretty good size file for changes in a database where no changes are supposed to be occurring unless this is relative to some other condition like icon changes for bookmarks or something else. If someone can write to these short files and then they are automatically transferred into the places or cookie database this could lead to abuse through tracking or site manipulation/spoofing but in the actual bookmark file.
I am probably off base with the tin foil approach on this but anytime something is automatically writing to the system it needs to be clarified more. Purpose and level of importance need be detailed a bit.

Grumpus

User avatar
 
Posts: 11907
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted August 22nd, 2011, 5:19 am

This morning I tried BlueFang's experiment and places.sqlite-shm and places.sqlite-wal files are created when opening about:blank and do leave the file tree when Firefox is closed. There is no indication of file size change after the close to other visible files but because the opened page is about:blank there is a zero value in the wal file while the shm maintains what appears to be a repeated 32Kb.

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 22nd, 2011, 7:12 am

The link you posted already explained what the SHM file was. It's a mmapped file backing shared memory. It's used to allow multiple simultaneous connections to the database.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 1 guest