Closed Bug 530704 Opened 15 years ago Closed 10 years ago

Firefox doesn't start if ~/firefox directory exists

Categories

(Firefox :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mozilla, Unassigned)

Details

User-Agent: Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.3 (like Gecko) Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091122 Gentoo Firefox/3.5.5 If you have a ~/firefox directory (which need not even contain anything), recent (3.5.2 works, 3.5.5 does not) versions of Firefox will not start. Reproducible: Always Steps to Reproduce: cd mkdir firefox firefox Actual Results: Output of "Could not read application.ini" and Firefox fails to start. Expected Results: Firefox starting correctly. I had an old beta binary of firefox directly from the mozilla.org site sitting around in my home directory. After a recent update (through Portage from www-client/mozilla-firefox-3.5.2 to www-client/mozilla-firefox-3.5.5) Firefox decided that it didn't want to start anymore. Discovering the above issue was very non-obvious. This was originally reported here: http://bugs.gentoo.org/show_bug.cgi?id=294133
If I understand correctly this has to do with how Firefox is started on Gentoo. On gentoo currently (www-client/mozilla-firefox-3.5.5) /usr/bin/firefox is a symlink to /usr/lib/mozilla-firefox/firefox, which seems to be the xulrunner stub (the usual shell script is not used). I also assume (after reading the linked problem description) your bug report here is not entirely complete: the problem is not having that "firefox" directory in your homedir, it's having a "firefox" directory in the current directory you start firefox from. The code involved is http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/cd24e78c2f2c/xulrunner/stub/nsXULStub.cpp#l271 which iiuc assumes that if argv[0] interpreted relative to the cwd exists that's the path we should use (this deals with things like ./firefox) and otherwise $PATH is searched for argv[0]. In your case argv[0] is just "firefox" and it exists in the current directory, so that's used as app dir, which breaks. I suspect it working in the past was because gentoo's firefox install still used a wrapper script then, which either changed the working directory or (more likely) invoked firefox as /usr/lib/mozilla-firefox/firefox (you should see that if you launch firefox as /usr/bin/firefox or /usr/lib/mozilla-firefox/firefox instead of just "firefox" it will start). That is probably also why I cannot reproduce this under gdb: it passes the full path as argv[0]. Possible improvements include: - Only accept executable files, not just anything that exists. That would have caught this case, but it's still not exactly reliable. - Check if there are any "/"s in argv[0]. I think it makes sense to only look relative to the cwd if there is at least one "/" (skipping the PATH search) and only do the path search if there is no "/". But I have not entirely thought this through: it might break a legitimate case I'm overlooking.
That's right, running it as /usr/bin/firefox or /usr/lib64/mozilla-firefox/firefox works correctly. Also, yes, up until recently /usr/bin/firefox was a wrapper script instead of a symlink. While not a separate case per se, it's worth noting that this also affects launching firefox via krunner (alt-f2) if you simply invoke firefox, which is where I originally stumbled upon this.
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing. http://support.mozilla.com/kb/Safe+Mode http://support.mozilla.com/kb/Managing+profiles You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]
Tested with 3.6.13, and the problem still occurs exactly as initially described.
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
I replied, see comment #4.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2011-1-30]
Please update this or close, I have tested with 35.0.1 on gentoo. I am unable to duplicate issue.
Flags: needinfo?(ns03ja)
Looks like this was fixed at some point, I can't reproduce the issue anymore.
Status: REOPENED → RESOLVED
Closed: 14 years ago10 years ago
Flags: needinfo?(ns03ja)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.