Closed Bug 1509277 Opened 6 years ago Closed 6 years ago

"Invalid Parameter" when launching firefox.exe from cmd.exe /C

Categories

(Firefox :: General, defect, P1)

Unspecified
Windows
defect

Tracking

()

VERIFIED FIXED
Firefox 65
Tracking Status
firefox65 --- verified

People

(Reporter: ccorcoran, Assigned: bugzilla)

References

Details

Attachments

(1 file)

Steps to reproduce: Launch firefox from a cmd.exe shell as follows:
> cmd.exe /C start firefox.exe

I see a message box saying "Invalid Parameter". Clicking OK will continue normal execution.

A quick debug, it's failing on OpenProcess() because the parent PID (which was the child cmd.exe) is no longer running.

I reproduced this on mozilla-central rev 28497e7f30ae
Oh crap, I've seen this before, but before I changed everything over to mozilla::Result, the launcher would end up doing the right thing (TM) and away we would go.

It's simply a race with the fact that our launching process might not exist anymore.
Assignee: nobody → aklotz
Blocks: 1508885, 1509203
Status: NEW → ASSIGNED
Priority: -- → P1
If the launcher process's parent process was ephemeral, the parent may have
terminated before the launcher has a chance to open a handle to it. If so,
OpenProcess will fail with ERROR_INVALID_PARAMETER, as the pid is now invalid.

This is a common case, so instead of erroring out, IsSameBinaryAsParentProcess
should treat this case as, "No, our parent was not a Firefox binary" and just
return false.

This eliminated the intermittent xpcshell failures on try.
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c8e66d503efd
Handle ERROR_INVALID_PARAMETER from OpenProcess differently from other errors in launcher process startup; r=cpearce
https://hg.mozilla.org/mozilla-central/rev/c8e66d503efd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Flags: qe-verify+
[testday-20181221] 

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
OS:  Windows 7 (64bit)
Status: Fixed & Verified 

Steps to reproduce: 
1) Press Windows Key + R
2) Type the following command in run box
> cmd.exe /C start firefox.exe
3) Firefox Launched without any error messages.

I have Reproduced the bug & The bug has been fixed in Firefox 65.0b6.
Thank you very much for verifying the issue.

Changing bug flags to verified fixed.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: