gecko-dev/docshell
Nika Layzell d47f4a615c Bug 1725572 - Avoid process-switching to a dead process, r=kmag
After some investigation, I was able to find a theoretical codepath
which could lead to the "missing initial frame browsing context" error:

1. Two iframes are created for the same origin, and begin process
   switching.
2. The first iframe finishes process switching, but for some reason
   (e.g. being in shutdown) the call to `LaunchSubprocessResolve`
   errors.
3. The second callback is called and also calls LaunchSubprocessResolve,
   which this time returns `true` due to it previously having been
   called.
4. The BrowserParent is created in the new content process despite
   `InitInternal()` never having been finished, and therefore the
   ContentParent never becoming subscribed to the BrowsingContextGroup.

To fix this, I made 2 changes:

1. Abort from process switching if the target process which we're going
   to be creating a BrowserParent in `IsDead()`, and
2. Track the return value from `LaunchSubprocessResolve`, so we return
   `false` if it is called a second time after a failed content process
   launch.

I'm not confident that this is the cause of the crashes, as I was unable
to reproduce the issue.

Differential Revision: https://phabricator.services.mozilla.com/D123548
2021-08-25 17:54:10 +00:00
..
base Bug 1725572 - Avoid process-switching to a dead process, r=kmag 2021-08-25 17:54:10 +00:00
build Bug 1695817 - Part 2: Introduce a blank page about:third-party r=Gijs,fluent-reviewers,xpcom-reviewers,kmag 2021-05-28 22:35:57 +00:00
resources/content Bug 1710334 - Fix misplacement of about:netError "Try Again" button. r=ckerschb,johannh 2021-05-30 22:48:07 +00:00
shistory Bug 1650089 - Part 3: Rework DocumentChannel-triggered process switches to support null principals, r=annyG,kmag 2021-08-10 14:31:17 +00:00
test Bug 1726305: Avoid throwing NS_ERROR_FAILURE when referring to the host in nsIURI. r=Gijs 2021-08-23 01:58:16 +00:00
moz.build