Closed Bug 1509277 Opened 3 years ago Closed 3 years ago
"Invalid Parameter" when launching firefox
.exe from cmd .exe /C
Bug 1509277: Handle ERROR_INVALID_PARAMETER from OpenProcess differently from other errors in launcher process startup; r=cpearce!
47 bytes, text/x-phabricator-request
|Details | Review|
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.
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 firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/c8e66d503efd Handle ERROR_INVALID_PARAMETER from OpenProcess differently from other errors in launcher process startup; r=cpearce
[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.
You need to log in before you can comment on or make changes to this bug.