Friday, 31 August 2007

Firefox freezes or hangs computer: fixed! & backing up Firefox






I thought I'd found the solution to the problem of my Firefox 2.0.0.4 browser freezing or hanging my Windows XP PC every few seconds (not just that browser and its tabs, but my entire computer - other programs and apps too). I reverted to an older version of Fox, and I found that a pre-release version of the next upgrade also worked fine. No more Firefox, or indeed my other software, not responding!

However, I was premature in my rejoicings - after a week or two, sadly those versions started making my computer hang too. So it was back to the drawing board on the troubleshooting front: and here are my steps and tips and the final answer, in case they may help anyone solve a similar problem.

The short answer: for me, I fixed the Firefox problem by creating a new profile and transferring selected settings across. Details below.

Firefox hangs

I started with the Mozillazine "Firefox hangs" page.

Now I knew it my case it wasn't Hang after prolonged or extensive use. I've been using Firefox for a couple of years or so, but they didn't mean "extensive" in that way; they meant, after opening Firefox and surfing for a while. Well, my problem was happening immediately on opening Firefox and viewing any webpage that wasn't blank - instant, not after lots of use. So that was out.

I also dismissed the topics about loading windows or certain sites, because it happened with Firefox viewing any site, plain Webpage, no need for any Java, Flash or PDF etc.

And I knew it wasn't down to anti-spyware or the like. In fact I'd recently got rid of anti-spyware installed by Google Pack which had been killing my computer (Norton Security Scan and Spyware Doctor, grrr. And a few months before that, WinPatrol). The problem only happened when Firefox was open on a webpage. Close it down, or leave it on a blank page, and everything else was fine again.

It wasn't my extensions. I didn't have any problematic extensions. I'd disabled, then in desperation uninstalled, every single one of my add ons - and still my PC was hanging. It certainly wasn't the addons.

So, it was on to the standard diagnostic.

Firefox diagnostics

I'd cleared my cache recently, but for good measure cleared it again. No go.

I was reluctant to try safe mode as I didn't want to lose my toolbar customisations and user preferences without trying other things first.

Now Susan had mentioned someone fixing their similar problem by cleaning their Firefox user profile (which stores your personalised bookmarks, passwords, extensions etc). So I thought I'd try that - creating a new profile while preserving the old one.

New profile - it worked!

There are very clear instructions on using the profile manager (with specific Windows instructions). The main thing is, after creating and naming a new profile, to make sure "Don't ask at startup" is NOT ticked. Then, just select or highlight the new profile and click Start Firefox to open Firefox using the new profile.

I found that with the new profile, everything worked brilliantly. So I had got to the bottom of my own particular problem. I carried on surfing for a couple of weeks in this way, selecting the new profile and making sure the freezes and hangs didn't recur. Once I was happy, I ticked "Don't ask at startup", selected the new profile and Start Firefox, and from then on whenever I launched Firefox it would automatically use my new profile.

Migrating profile settings

The final step was to transfer my settings from the old profile to the new one. Now you have to be careful with this because if the problem was with something that went wrong or corrupt in your old profile, then you could end up just transferring the problem across too.

Those with more courage than me and a lot more time on their hands may want to try figuring out and fixing the problem in the original profile. As I'd torn out enough hair on this, I was content just to transfer selected info across from old to new profile. Again the instructions were very clear. I followed their advice and did not copy across:
  • the extensions folder, or
  • prefs.js,
but instead I reinstalled my key extensions from scratch and set up my preferences from scratch too. Luckily I was able to copy across my bookmarks, history, cookies and saved passwords, which saved a lot of time.

I haven't yet deleted the old profile, but I could now.

I also had to re-set a few extension preferences, the most important (for me personally) being:
  • HTML validator opens up with Ctrl-Shift-a, but I use the same hotkeys for adding links in the Blogger post editor. I'd forgotten how to get rid of that - well it was in the Web Developer add-on options, Keys section - I just had to change Ctrl-Shift-a for Validate to something else, and my Blogger hotkeys were working again.
  • Tab Mix Plus options - in the Display options, Tab bar, I have to tick to display the Close tab button or else I don't know where I am, I really rely on that button! I'd also lost my rightclick context menu "Open links in background tab" option and it took me a while to figure out again that it's only visible in Tab Mix Plus's Menu option (Main Context Menu tab) if in Firefox's main Tools, Options, under Tabs, the box for "When I open a link in a new tab, switch to it immediately" is ticked.

Noting your extensions / add-ons

One thing I've learned from this is to make sure I have a list of my key extensions (I had to go into my old profile and painfully endure the hangs again to extract that info).

Easiest lazy way: in Firefox go to the Tools menu, Add-Ons, press the Print Screen key on the keyboard, paste (Ctrl-v) that into Word or a draft Outlook email etc, back to the extensions list, scroll down if necessary, do another screen print and paste again etc, save that document or note - and there's my list! Quick & dirty but it worked for me.

Less primitively, you could backup your fave extensions together with the rest of your profile, or even package up your fave extensions into a single xpi file to reinstall them all at once using CLEO, see below.

Backing up Firefox preferences, profile etc

All this has made me realise I ought to backup my Firefox settings regularly, in case of future disasters.

There are various options:
  • manually copy your profile folder somewhere else, or
  • use a dedicated backup tool like the free FEBE (which can even do scheduled backups, and selective restores). Use it with CLEO if you wish (see the CLEO FAQ - it's easiest to download and save the relevant .xpi files into the same folder on your computer first rather than fish around in your Extensions folder!).

6 comments:

Efendi said...

so what cause the problem ? is it the profile ?
is it the cache in those profile ?

the one i noticed is when i opened up a page that has a java applet in it, ff will froze ! even if it just a simple applet !

Improbulus said...

Hi Efendi, well it was definitely something in the old profile, but I didn't want to spend any more time trying to figure out exactly what was causing the problem, I'm just relieved it's all working now! Have you tried the detailed checks yourself?

Pigmouth said...

Thanks for posting this. It really helped me out.
My problem seemed to be that the profiles were automatically stored in the "my documents" folder, and that folder is on an external drive. There seemed to be something fishy with the connectivity to that drive, and therefore I had to create my new profile on a local drive.
After that the problems are gone.

Thanks again.

JForce said...

I love you. You have saved me.

By the way, I think if you just rename the corrupted profile it will work. That's what I did. It hasn't started hanging on me yet.

Aziz said...

I'm having a similar problem. It happens quickest if I try to configure Xmarks... but it will happen without doing that after an indeterminate amount of time (or certain sites)

I've just installed a fresh copy of Win 7 Pro 32-bit. No extensions, I've tried completely uninstalling Firefox and reinstalling a fresh version (according to their guidelines). It hasn't crashed in FF safemode, but it does crash in Windows safemode (FF "dangerous" (?) mode).

I'm really at a loss. I may try that profile manager route, but I doubt it's the solution.

Any suggestions? It's really quite a pain in the ass as it locks the entire computer up and the only solution is hard reset.

Thanks
Anthony Aziz

Anonymous said...

yes, by gum & golly...this here stuff works...careful how you do it, follow the instructions to the letter and thou shalt be browsing again in no time at all!