"Couldn't load XPCOM" error when launching Firefox via ./firefox from Contents/MacOS in Terminal

RESOLVED FIXED in Firefox 34

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: spohl, Assigned: spohl)

Tracking

Trunk
mozilla35
All
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox34 fixed, firefox35 fixed)

Details

Attachments

(1 attachment)

BinaryPath.h fails to sanitize the path when a user launches Firefox as follows:
1. In Terminal, cd to Contents/MacOS
2. Run ./firefox

This is due to the fact that BinaryPath::Get does not sanitize the path on OSX. The returned path in this scenario would be:
Contents/MacOS/./firefox

XPCOMGlueLoad would then manipulate this path to find the dependentlibs.list file as follows:
1. Remove executable from path:    Contents/MacOS/.
2. Remove last path component:     Contents/MacOS
3. Add 'Resources' path component: Contents/MacOS/Resources

The resulting path should have been Contents/Resources. The above path will fail and result in a "Couldn't load XPCOM" error.
Note that this used to work before the v2 signature changes because all files were in the same directory (Contents/MacOS), so a path of Contents/MacOS/./dependentlibs.list used to work.
Posted patch PatchSplinter Review
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Attachment #8500601 - Flags: review?(smichaud)
Comment on attachment 8500601 [details] [diff] [review]
Patch

Looks fine to me.
Attachment #8500601 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/projects/oak/rev/f4c31beca62b

Inbound and fx-team is currently closed. Setting checkin-needed just in case.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5884c9f92f3d
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Blocks: 1079655
This change introduced a serious regression for me, as now I can't start firefox at all. see bug 1079655
No longer blocks: 1079655
Depends on: 1079655
Landed on aurora in the Mac V2 signing combined patch in bug 1047584
You need to log in before you can comment on or make changes to this bug.