Firefox Aurora PPA build fails to load XPCOM

Bug #809384 reported by Ben Hearsum on 2011-07-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Ubuntu Mozilla PPA Bugs
Chris Coulson
firefox (Ubuntu)

Bug Description

I first experienced this as links from other applications failing to open, but then after shutting down Firefox altogether I couldn't relaunch it without having /usr/lib/firefox-7.0a2 in LD_LIBRARY_PATH. I can't reproduce this problem with the upstream build.

Attached is the output from "strace -f firefox"

Ben Hearsum (bhearsum) wrote :
Chris Coulson (chrisccoulson) wrote :

Confirmed that creating an empty "firefox" folder in my home folder is enough to prevent the aurora build from starting

Changed in ubuntu-mozilla-ppa-bugs:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Chris Coulson (chrisccoulson)

On current nightly and aurora builds, Firefox will fail to start with "Couldn't load XPCOM" under these conditions:

1) The executable is loaded from the users PATH,
2) There is a file called "firefox" in the current working directory

This is because if you pass a relative path to realpath, it will resolve the path if the file exists in the current working directory. This causes mozilla::BinaryPath::Get() to return the wrong path.

This was reported to by Ben, who experienced this because he has a folder named "firefox" in his home directory. This is enough to prevent a current aurora build from starting

Created attachment 545732
Don't call realpath when loaded from PATH

This fixes it by not calling realpath() if we are executed from the users PATH. This is determined by the absence of any separators in argv[0]. I did consider also checking that the result is actually an executable file too, but that seemed overkill.

*** This bug has been marked as a duplicate of bug 670788 ***

Changed in firefox:
importance: Unknown → Medium
status: Unknown → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.