Closed Bug 1460996 Opened 6 years ago Closed 6 years ago

Bootstrap process should always convert argv[0] to absolute path

Categories

(Firefox :: General, defect, P1)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

(Blocks 1 open bug)

Details

(Whiteboard: inj+)

Attachments

(2 files)

STR:

1. Install a Nightly build that includes the launcher process.
2. Open cmd.exe and navigate to the directory that you installed Nightly into.
3. Run "firefox --launcher -no-remote -P"

Expected:
The profile manager is shown.

Acutal:
An error MessageBox is shown.

This is because argv[0] is just "firefox", which we then attempt to pass into CreateProcess or ShellExecute.
Attachment #8975173 - Flags: review?(mhowell) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b170a499777a8fbde9e85587af913a7082fbb428
Bug 1460996: Ensure the bootstrap process is always working with an argv[0] containing an absolute path; r=mhowell
https://hg.mozilla.org/mozilla-central/rev/b170a499777a
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
I'm not super happy with the way I did this, so I'm reopening to land a better implementation.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Two beefs I had with my previous implementation:

1) We'd pay the price of that statically-allocated memory buffer even for non-bootstrap instances;
2) We can get rid of all of that FS access caused by SearchPath if we just query the path for the module.

Of course, GetModuleFileName is not a sane API with respect to buffer sizing, but oh well. I don't really care if we leak a buffer that's larger than the string, since it's just for bootstrapping.
Attachment #8975547 - Flags: review?(mhowell)
Attachment #8975547 - Flags: review?(mhowell) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a6b6db92a0e95f19dd8d9ddf665981e02b6b198
Bug 1460996: Ensure the bootstrap process is always working with an argv[0] containing an absolute path (v2); r=mhowell
https://hg.mozilla.org/mozilla-central/rev/7a6b6db92a0e
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
QA Whiteboard: [good first verify]
Flags: qe-verify+
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: