Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4430 closed defect (fixed)

Fully Disable Session Store+Restore on Mac+Linux

Reported by: mikeperry Owned by: mikeperry
Priority: Very High Milestone: TorBrowserBundle 2.2.x-stable
Component: TorBrowserButton Version:
Severity: Keywords: tbb-disk-leak, MikePerry201204
Cc: Actual Points: 1
Parent ID: Points: 1
Reviewer: Sponsor:

Description (last modified by mikeperry)

After some crashes, I've noticed that the session store sometimes still remembers one of my visited sites. Not always, just sometimes... And always just one tab, even though it remembers several windows w/o any child tabs. Ugh.

Child Tickets

Attachments (2)

sessionstore.bak (6.1 KB) - added by isis 7 years ago.
sessionstore.js (847 bytes) - added by isis 7 years ago.

Download all attachments as: .zip

Change History (29)

comment:1 Changed 8 years ago by mikeperry

Description: modified (diff)

comment:2 Changed 8 years ago by cypherpunks

This is bad. I've checked my sessionstore.js and it does contain the title of a website I've visited. Writing this kind of information to a HDD in plain text is a critical issue and it should be fixed ASAP. Is there anything one could do to help you pin down the root of the problem?

comment:3 Changed 8 years ago by rransom

Priority: majorblocker

comment:4 Changed 8 years ago by rransom

We just had a report in #tor-dev that this happened to another user (TBB 2.2.35-5 on MacOS).

comment:5 Changed 8 years ago by mikeperry

Keywords: tbb-disk-leak added
Priority: blockercritical
Summary: Session Store filter sometimes fails?Fully Disable Session Store+Restore

Hrmm. My money is on this one being due to attempting to maintain the toggle model in the filter. We should simplify the filter. It should either remove everything, or nothing.

Alternatively, we could look into how Firefox disables the Session Store for Private Browsing (but still keeps features like Undo Closed Tab working).

comment:6 Changed 8 years ago by mikeperry

#4462 was dupped to this.

comment:7 Changed 8 years ago by mikeperry

Milestone: TorBrowserBundle 2.2.x-stable

comment:8 Changed 8 years ago by rransom

We just had another report of this in #tor.

comment:9 Changed 8 years ago by mikeperry

Keywords: MikePerry201204 added

Changed 7 years ago by isis

Attachment: sessionstore.bak added

Changed 7 years ago by isis

Attachment: sessionstore.js added

comment:10 Changed 7 years ago by isis

I just experienced this after my computer crashed with TBB open. There were two interesting files in my TBB directory, sessionstore.bak and sessionstore.js. The former contained all my browsing history from the session before the crash, and also two other interesting bits: "_shouldRestore":true, "recentCrashes":1

I've scrubbed my history from those files and attached them.

comment:11 Changed 7 years ago by mikeperry

isis: Are you able to reliable reproduce that? For example by killall -11 firefox? Because I am not. The hard part of this bug is reproduction. If we can reproduce it, we can just try tweaking a few about:config prefs and see what happens (for example, browser.sessionstore.max_entiries sounds promising). Those prefs did not work for torbutton (they aren't effective immediately), but we don't give a fuck about that anymore and they may now be enough for us.

Removing the Torbutton session store filter might make this easier to reproduce.. The most sure-fire way to do that, we need to remove these two lines from Torbutton's chrome.manifest:
component {aef08952-b003-4697-b935-a392367e214f} components/tbSessionStore.js
contract @torproject.org/torbutton-ss-blocker;1 {aef08952-b003-4697-b935-a392367e214f}

comment:12 Changed 7 years ago by mikeperry

Ok, I disabled that component, got an easy repro, and it turns out that if you set *both* browser.sessionstore.max_entires and browser.sessionstore.max_resumed_crashes to 0, then Firefox seems to decide to set browser.sessionstore.privacy_level to 2 for you, and *then* it stops writing sessionstore.js at all. Who knows if we actually need to set all three, or just that magic last one...

The extra good news is that this only sort of breaks "Undo closed tab". You still get the old url there, it just doesn't automatically reload? Good enough for me.

comment:13 Changed 7 years ago by mikeperry

Oh, I also set browser.sessionstore.resume_from_crash to false, which may or may not have mattered... Now to try to narrow those four down.

comment:14 Changed 7 years ago by isis

Ah, so I am able to reproduce it, but only when X crashes. I am rebuilding my own TBB right now because I noticed that browser.sessionstore.resume_from_crash was set to true, and testing it. I'll report back once I've figured out this crazy build script y'all have.

comment:15 Changed 7 years ago by isis

Changing setting browser.sessionstore.resume_from_crash to false fixes the problem for me.

comment:16 Changed 7 years ago by isis

Also, building TBB: not for the faint of heart, yo. I do not envy you and Erinn.

comment:17 Changed 7 years ago by mikeperry

Actual Points: 1
Points: 1
Resolution: fixed
Status: newclosed

Confirmed what isis reports. Setting browser.sessionstore.resume_from_crash alone is sufficient, and "undo closed tab" is actually fully functional in that case. I've updated #5642 for the pref update to get into the next TBB.

comment:18 Changed 7 years ago by cypherpunks

sessionstore.js is still created in /FirefoxPortable/Data/profile/ in TBB 2.2.35-9, and here's a string copied from the JSON:

"title":"#4430 (Fully Disable Session Store+Restore) – Tor Bug Tracker & Wiki"

So no, not fixed, at least not in Windows 7. One good thing is that you may have actually reduced the number of cases where the file is touched/handled, because sessionstore.bak, which was created in the previous versions, does not appear.

comment:19 Changed 7 years ago by mikeperry

cypherpunks: are you sure that isn't an old sessionstore.js from before you upgraded? What is the value of your about:config pref browser.sessionstore.resume_from_crash? And are you able to reproduce this?

It doesn't happen for me on Mac or Linux...

comment:20 Changed 7 years ago by cypherpunks

I'm positive, I always remove the old Tor Browser directory and then start with a clean bundle. Before starting Tor Browser, I had checked the profile folder specifically to observe if sessionstore.js is created (I always slap the read-only attribute on it when it turns up) and the file wasn't there until it was created during the session. The value of browser.sessionstore.resume_from_crash is false. I can see that the content of sessionstore.js changes, so it's definitely not a one-off incident.

comment:21 Changed 7 years ago by mikeperry

Yes, sessionstore.js is created for me on Linux (not on Mac), but it's has only minimal json with some window information. No urls are present.

Does every url you visit get recorded in your sessionstore.js, or only some? If only some urls, is there anything you can do to trigger a url to get recorded?

comment:22 Changed 7 years ago by cypherpunks

My sessionstore.js does not contain any urls either: http://pastebin.com/eWSnvqKC

As you may imagine, storing the "title" of a website may expose some sensitive info too, even if urls are not present.

Usually, just a single tab is stored. I'm not sure what triggers it yet. That "_shouldRestore":true is suspicious.

comment:23 Changed 7 years ago by mikeperry

What is your value for browser.sessionstore.privacy_level? What happens if you use a completely new TBB dir and try a fresh TBB instance?

I'm not sure how this is any different on Windows than on Linux or Mac. The code that implements the session store is all Javascript.. It's got to be either a pref you've set, an addon you have installed, or some other thing you're managing to trigger that I'm not able to.

comment:24 Changed 7 years ago by cypherpunks

browser.sessionstore.privacy_level == 2

I've not touched any settings or installed any add-ons yet. The same things happens with a new profile in a separate directory, and I have noticed that the file is not created until you close Tor Browser. Refresh the profile directory right before and after closing TB to make sure that you have the most recent view.

comment:25 in reply to:  24 Changed 7 years ago by mikeperry

Replying to cypherpunks:

I've not touched any settings or installed any add-ons yet. The same things happens with a new profile in a separate directory, and I have noticed that the file is not created until you close Tor Browser. Refresh the profile directory right before and after closing TB to make sure that you have the most recent view.

Again, doesn't happen on Mac or Linux. Is this *every* time you exit the browser with a tab open? Do you exit by closing the browser, or by telling Vidalia to quit?

comment:26 Changed 7 years ago by cypherpunks

Yes, every time. I exit by closing the browser.

comment:27 Changed 7 years ago by mikeperry

Summary: Fully Disable Session Store+RestoreFully Disable Session Store+Restore on Mac+Linux

Alright. I've created #5710 for you. I think this is a technically Firefox bug. Leaving this bug in place since it is just for the pref change.

Note: See TracTickets for help on using tickets.