Firefox: “Unable to Terminate Process” and “Another Instance Is Already Running”

I was using portable Firefox ESR (Extended Support Release) 38.6.1 in Windows 7. Certain tabs weren’t loading. The URL was there in the address bar, but the page was blank. I wasn’t sure what was causing that. Sometimes it would work to copy the URL and try again in another tab, but that wasn’t working for these tabs.

I decided to try to kill and restart Firefox, in case that would fix the problem. Firefox seemed to close. But I could not get it to restart. When I tried, I got this error:

Another instance of Firefox is already running. Please close other instances of Firefox before launching Mozilla Firefox, Portable Edition.

At this point, the most recent version of the non-portable, installed Firefox was 44. I didn’t have that installed, so I downloaded and installed it. Unlike the portable, it was able to load. So that was one solution to the restarting problem.

But I continued to try to make the portable version work. I went into Windows Task Manager (available via Ctrl-Alt-Del or by using Win-R or the Start Menu to open the Run dialog > taskmgr.exe). (My Run dialog was set to commence tasks with administrator privileges.) I looked in its Processes tab. It showed three firefox.exe processes, but no FirefoxPortable.exe processes. I closed the Firefox 44 session that I had just installed. That took care of one of the three firefox.exe processes. But like others, I couldn’t kill the two that remained. When I right-clicked > End Process (or End Process Tree), I got an error:

Unable to Terminate Process

The operation could not be completed.

Access is denied.

One solution was to reboot. But after doing that, the problem would soon recur. I didn’t want to have to be restarting my computer all the time. I found that others were getting this error message for programs other than Firefox. Since it seemed like a generic problem, I wrote a separate post that explored possible solutions to that problem. The remainder of this post focuses on Firefox-specific solutions.

A How-To Geek webpage pointed toward Mozilla’s Profile in Use webpage. Geek observed that the Mozilla page offered solutions for multiple possible Firefox problems, but suggested that a common solution would be to delete the Firefox parent.lock file. (Doing so might require the assistance of Unlocker.) The location of that file would depend on whether the system was using an installed or portable version of Firefox. (Note that other programs might have their own parent.lock files, which I wouldn’t want to delete.) Geek noted that, for installed versions, parent.lock would be in a randomly named .default folder that the user could find by running this command in the Windows Run box (available through WinKey-R) (note: WinKey is the key with the Windows icon on it, located at the bottom left and/or right corner(s) of the keyboard):


I personally found it easier to use the Everything file finder to find the location(s) of parent.lock. I was then able to delete the parent.lock files in the Everything list. (Note: Thunderbird and other programs may also have their own parent.lock files.)

For some, this was the last straw: I saw people saying that, for them, it was time to use a different browser. I did download the 64-bit portable version of Pale Moon as a backup, but decided to proceed with Firefox troubleshooting.

It appeared that the parent.lock problem could be caused by a malfunctioning Firefox extension. One troubleshooting solution would be to disable all extensions, restart Firefox, and see if the problem persists. This could be done in Firefox > Tools > Add-ons. In my case, there were already some disabled extensions. Disabling others would mix up the list: now all of my extensions would be disabled, and I wouldn’t know which ones to re-enable. (I was keeping the disabled ones because they were duplicative but might prove useful in the future, if others ceased to be maintained.) To remember which extensions had been in active use, I made a list. At this writing, InfoLister was back in the game and useful for that purpose, creating an HTML list with links to the download page for each add-on. Troubleshooting would then call for re-enabling Firefox extensions, one or more at a time, so as to identify the extension causing the problem.

Interestingly, disabling all extensions seemed to expose two viruses in the Firefox cache: my AVG antivirus popped up repeatedly, asking if I wanted to delete them, which I did. I decided to run a Malwarebytes scan to see why AVG kept finding more viruses. But it didn’t find anything, and after a while it seemed AVG had taken care of it. It appeared that perhaps an extension had been able to hide its virus components as long as it was enabled.

I noticed that disabling all extensions also solved the original problem that had motivated this post. All tabs were now loading. But I still wasn’t able to completely kill all firefox.exe processes.

I rebooted the system. I noticed that Freemake Video Downloader wanted to install an update. I suspected it might be the source of at least some virus problems. There appeared to be some confirmation of this. I uninstalled it. Unfortunately, that did not solve the problem. A few days later, it was back.

This time around, I tried running CCleaner. I ran its analysis, but in its Applications tab I excluded most Firefox entries. It may have seemed obvious that I should clean out everything related to Firefox, but I had spent too many years deleting the Firefox cache, cookies, and history at the suggestion of some support technician, only to find that none of these were the issue and that their instructions had wiped out many helpful little bits of information that I now had to reconstruct. Cleaning the cache etc. was an option, but not yet. In CCleaner, I was particularly interested in removing large files (so as to free up disk space) and in the CCleaner Registry analysis. Unfortunately, these efforts did not solve the Firefox problem.

I decided to follow How-To Geek’s advice on creating a Safe Mode startup icon for Firefox Portable. The steps were as follows: (1) Copy the existing Firefox Portable icon (or create a new icon pointing at FirefoxPortable.exe) and rename it as Firefox Portable Safe Mode. (2) Right-click on that new icon > Properties > Shortcut tab > Target box > at the very end of the existing command, after the quotation mark, add a space and then type -safe-mode > OK. I rebooted, so as to kill the unkillable Firefox session, and clicked on that Safe Mode link. It ran. I got Firefox with one tab, my home page. In Normal Mode, I had maybe a hundred tabs open. Lots to do. Here in Safe Mode, nothing. It didn’t have the Session Manager add-on, so I couldn’t just resume the previous session. I’d have to mess around with getting each of those tabs open in Safe Mode.

For a while, I thought the problem might be that, as discussed in the other post, I was using Ctrl-Alt-Del to lock the computer. But then (a) doing that didn’t cause the problem and (b) I got the problem even when I rebooted and refrained from using Ctrl-Alt-Del. A later search brought up the suggestion to copy FirefoxPortable.ini from its original location (in the portable Firefox Sources folder) to the folder where FirefoxPortable.exe appears, and edit that copy to say AllowMultipleInstances=true. This had an effect, though I wasn’t sure whether it was helpful: now I was getting a different message:

Firefox is already running, but is not responding. The old Firefox process must be closed to open a new window.

I seemed to get this error especially when I ran a batch file that would normally succeed in opening multiple Firefox tabs. I thought maybe I was having this problem now because I failed to close Firefox Portable while doing that edit. I closed Firefox at this point, made sure there was no running Firefox process in Task Manager, restarted Firefox, and tried again. No, that wasn’t it: still a problem.

In Task Manager > Processes tab, I right-clicked on each of the two running firefox.exe processes and selected Open File Location. This opened a session of Windows Explorer in the FirefoxPortable\App\firefox64 subfolder. There was a Firefox.exe (not FirefoxPortable.exe) at that location. But that was not where my Firefox shortcut was pointing. I thought I was running FirefoxPortable.exe, located two levels up, in the FirefoxPortable folder. Did Firefox Portable ship with two different firefox.exe or FirefoxPortable.exe files, or had I somehow screwed that up? I reinstalled my downloaded copy of Firefox Portable 44. Well, not “install”: I just ran it and let it unpack itself in a folder. Then I looked and, sure enough, there was a FirefoxPortable.exe and also a Firefox.exe, in the locations just described. So that wasn’t my fault; that was how it came.

I closed my customized copy of Firefox Portable and ran FirefoxPortable.exe in this new FirefoxPortable folder that I had just created. As before, Task Manager reported that both firefox.exe (in the firefox64 subfolder) and FirefoxPortable.exe (in the FirefoxPortable folder) were running. So it appeared nothing was amiss there. It appeared the advice about creating a second FirefoxPortable.ini was mistaken. I deleted that copy and edited the original FirefoxPortable.ini, in the Other\Source subfolder, to allow multiple instances, as above. (I had configured the TabMixPlus add-on to open all tabs in one window.) Then I restarted Firefox and tried running the batch file again. This time it worked without error: all tabs opened in the existing Firefox session. I hoped that meant the problems were solved.

But they weren’t. I had to revisit this problem again later. This time, I renamed X:\Start Menu\Programs\Online\Browsing & Searching\Web Browsers\Mozilla Firefox\FirefoxPortable 44\App\firefox64\firefox.exe to be firefox.old. I hoped this would enable X:\Start Menu\Programs\Online\Browsing & Searching\Web Browsers\Mozilla Firefox\FirefoxPortable 44\FirefoxPortable.exe to retain the “default browser” setting. I also noticed, this time around, in Task Manager, that the version that I could easily kill was firefox.exe *32 (and also FirefoxPortable.exe *32), not just plain firefox.exe (presumably 64-bit). This was consistent with the impression that sometimes the 64-bit applications are problematic.

It turned out that, when the problem arose later, it might be because I had recently updated Firefox, and apparently that installed a new parent.lock file. I deleted the parent.lock file again. After rebooting, the problem once again seemed to be solved.

This entry was posted in Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

2 Responses to Firefox: “Unable to Terminate Process” and “Another Instance Is Already Running”

  1. Gary Linsday says:

    Is SPLWOW32 running (Windows 64 bit driver to make 32 bit printers run)? It’s been crashing my Firefox a lot recently.

    • Ray Woodcock says:

      I don’t know if it was running then, when I wrote that post, but I have just returned to this post, having the problem again, and SPLWOW32 is not running, as either a process or a service in Task Manager. But it was worth looking into. Thanks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s