Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Saturday, March 10, 2012

Recovering from repeated crash at Firefox (11 Beta 7) start-up

Quick Solution
 
Delete
  • session.js
  • sessionstore.bak
  • files inside sessions folder
from inside your Firefox profile directory. Follow this page to find out where you profile directory is located.

How I found what caused the crash
 
After quite few "unresponsive script" error inside Firebug 1.9.1 (mostly on LifeHacker.com and Boston.com) and repeatedly selecting "Stop Script" with no apparent benefit, I chose to kill Firefox from Windows Task Manager [1]. For those who don't know that it is - try pressing "CTRL+Shift+Esc" on your keyboard or just right-click on your task-bar and select "Start Task Manager". It looks like this:


I didn't realize the fun is just about to begin. To my surprise, upon the next restart Firefox started as usual and but quickly crashed. It kept happening much like flashing the Firefox's main window for a second or two and boom, it crashed! This behavior was already a good indication that it might be caused by a corrupted file, most probably a SQLite [2] database and this must have happened due to my killing Firefox forcefully using the Windows Task Manager. So, I started to digging around for a resolution.

First, I tried to start Firefox in "Safe Mode" with all add-ons disabled as suggested here [3] with "-safe-mode" flag. It didn't work! From my all previous experience, Firefox's safe-mode always seemed the best way to solve crash related problems, buggy extensions and add-ons. But, in this case it kept crashing even in safe-mode.

Then, I tried to open Firefox in "Private Browsing" mode with the "-private" flag. On Windows 7 (I guess on Vista too), this can be done with right-clicking the Firefox task-bar icon and selecting "Enter Private Browsing". Interestingly, Firefox was able to start in this so-called incognito mode! This was another strong hint that some files must be corrupted in my "Firefox Profile Folder" [4].

To try the theory, I closed all running instances of Firefox and I renamed Firefox's "profiles.ini" [5] to "profiles.ini.bak" to force Firefox into creating a fresh new profile. I started Firefox and it successfully created a new profile in my "%APPDATA%\Mozilla\Firefox" directory. The new profile directory was named "an9pz0cj.default".  By the way, if you are like me and you love your Firefox's plethora of customized settings and very longs list (77 in my case) of plugins only to profoundly avoid reinstalling them, don't forget to regularly backup your profile directory. My default previous profile directory was called "yn0z15ze.default" and I backed it up in a RAR archive.  After generating a fresh profile, which also generated a new profiles.ini, I copied all files (not folders, I decided to try them in the second iteration) from "an9pz0cj.default" and pasted them in "yn0z15ze.default". Windows 7's copy and paste is great. It kept showing me all the conflicts due to size, date-time of source and destination files. I kept the list of the files where the file-size was different. In my case, the list looked like the following:
  • cert8.db - SSL certificates are stored here.
  • chromeappsstore.sqlite -- HTML5 local data store.
  • content-perfs.sqlite -- Individual settings for pages.
  • permissions.sqlite -- Permission database for cookies, pop-up blocking, image loading and add-ons installation.
  • search.sqlite -- Information about search plugins
  • sessionstore.bak -- saved sessions.
  • sessionstore.js -- saved previous session
  • signons.sqlite -- Encrypted saved passwords
  • TestPilot.log --  Log file.
  • webappsstore.sqlite -- DOM local storage.
I Google'd up on the name of the files and got a rough idea of what they are meant for and how they are used inside Firefox. So, at this point I my preferred profile "yn0z15ze" is working but with some default files which means I must have lost some data, may be some customizations too as the list contains cert8.db, search.sqlite and signons.sqlite etc.

Now comes the final part - I have to test each of the files above one by one and figure out which one was causing the crash. As you may have gotten the idea already - I love my Firefox and my customizations. So, I wanted to make sure that I lose minimum amount of data due to the crash.

So, I renamed my previously moved "profiles.ini.bak" to "profiles.ini". By the way, profile.ini looks like below:
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/an9pz0cj.default
Default=1
So, I could have just replaced "an9pz0cj" with "yn0z15ze" and saved profile.ini to achieve switching between profiles. Anyways, I did that anyhow and started copying files as shown on the bulletted list above from  "yn0z15ze" RAR archive to now running "yn0z15ze" with some fresh files of "an9pz0cj". I kept restarting Firefox each time to check if Firefox is crashing. After a few iterations of stopping Firefox, copying fresh files into "yn0z15ze" and restarting, I stopped at "sessionstore.js". I copied this file and Firefox crashed!

Wow, so now I know which file was causing my Firefox to crash! Also, now that I know this file only contains a list of my tabs which I was browsing before the very initial task-manager kill, I can safely disregard this file now ;). Phew, so the case is solved. If you happen to come across a situation like mine, try deleting the "session.js" and/or "sessionstore.bak" and/or files inside "sessions" folder. It's weird that even in Firefox's safe-mode the problem managed to persist. Time for a bug report I guess :). Hope you find it useful.

[1] http://en.wikipedia.org/wiki/Windows_Task_Manager
[2] http://en.wikipedia.org/wiki/Sqlite
[3] http://kb.mozillazine.org/Safe_Mode
[4] http://kb.mozillazine.org/Profile_folder_-_Firefox
[5] http://kb.mozillazine.org/Profiles.ini_file

Wednesday, August 24, 2011

Remove Firefox add-ons installed by 3rd Party Applications

The list of add-ons with pointers to the XPI code is here:

HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions.

Just remove the unwanted entry from the list. Cheers :).

Tuesday, August 23, 2011

Multiple Java Console add-on in Firefox

I recently discovered more than one Java console add-on inside my add-ons manager in my Windows 7 machine. Since I only had only one version of JRE (Java Runtime Environment) updated to the latest version, this did not make sense. To make it more of an eye-sore, these add-ons did not have an associated "Remove" button in the add-on manager.

Some Google-ing revealed these are Java update left-overs. They do not have the "Remove" button because they are installed inside the %ProgramFiles(x86)%\Mozilla Firefox and not inside the %AppData%\Mozilla\Firefox profile directory.

In my installation, I had the following directories inside %ProgramFiles(x86)%\Mozilla Firefox\extensions directory:
  • {CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}
  • {CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}
  • {CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}
The blue numbers are indicative to the Java versions. To remove older left-overs, just keep the folder with associated with the latest Java version, which usually is the highest number in the list and delete the others.

Wednesday, September 8, 2010

Install Windows from portable USB drive

This Windows tool [1] can apparently convert a Windows CD/ISO image (and also other Live CD/DVD images) into a boot-able USB stick. For whatever it is worth, it's Good to know there exists such a thing for Windows installation.

[1] http://www.wintoflash.com/home/en/

Friday, July 23, 2010

Windows 7: Windows Media Player 12 "Server Execution Failed" problem

I found the solution here: http://social.answers.microsoft.com/Forums/en-US/w7music/thread/ecc08c3b-d445-48c2-b07d-9df48500434f

The solution that worked for me:
  1. Unpin media player from taskbar.
  2. Pin it back.
lol, yes, that literally solved the problem for me.

Monday, May 3, 2010

Splitting 4 GB or bigger files for Fat32

Fat32 can not handle files bigger than 4 gigabytes. Surprisingly Fat32 still prevails on almost every USB stick. 'Split' command in Linux can be very handy to transfer files bigger than 4 gig using USB sticks.

Copy & paste the following to split file on Linux:

split --verbose --numeric-suffixes --bytes=3990000000 'large_input_file.mkv' 'output_'
Joining can be done by 'cat' or 'copy /B' on Windows.

Sunday, January 24, 2010

Java is not working in Windows Firefox ...

1. Reinstalling Java fixed it for me. You can download it from here:
http://www.java.com/en/download/
2. Some people also recommended deleting "NPOJI610.dll" from Firefox/Plugins directory.