Closed Bug 1774201 Opened 4 years ago Closed 4 years ago

If GPU process dies before InitRendering then subsequent ReinitRendering fails

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- fixed
firefox101 --- wontfix
firefox102 --- fixed
firefox103 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

I discovered this while investigating bug 1772839. I commented out the DestroyEGLContext line here. This means that when you switch to a new tab, pausing the old compositor does not destroy the EGL surface. Therefore when we attempt to resume the new compositor, it fails, and we end up restarting the GPU process. This could occur in the wild if we encounter a WebRender error during initialization.

Because the GPU process has died while the content process is in the middle of RecvInitRendering, creating the WebRenderLayerManager fails, and we set mLayersConnected = Some(false) here.

Once the GPU process has been restarted, we call ReinitRendering. However, due to this line (introduced in bug 1728062) we exit early. This means the new tab forever remains in an unusable state.

If we changed the early-exit condition to if (mLayersConnected.isNothing()) that would fix this. (As the value is Some(false)). Sotaro, do you remember if doing that would still fix bug 1728062?

Flags: needinfo?(sotaro.ikeda.g)

Set release status flags based on info from the regressing bug 1728062

Severity: -- → S3
Has Regression Range: --- → yes

In bug 1728062 we made it so that we that we skip
BrowserChild::ReinitRendering if the BrowserChild is not connected to
a compositor. This was in order to avoid initializing the compositor
for windowless browsers.

However, in cases where the GPU process dies before an initial
InitRendering has completed, then the BrowserChild will also be left
not connected to a compositor, with mLayersConnected == Some(false).
ReinitRendering will be called once the new GPU process has been
launched, but due to this condition we will exit early, and the tab
will be left in an unusable state.

To fix this, this patch changes the early return condition to only
check for mLayersConnected.isNothing(), ie we never even attempted to
initialize rendering. When it is Some(false), ie we attempted and
failed, then ReinitializeRendering is still executed.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED
Pushed by jnicol@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc564899ced4 Stop skipping ReinitRendering if previous attempt failed. r=gfx-reviewers,aosmond

(In reply to Jamie Nicol [:jnicol] from comment #0)

If we changed the early-exit condition to if (mLayersConnected.isNothing()) that would fix this. (As the value is Some(false)). Sotaro, do you remember if doing that would still fix bug 1728062?

Hmm, it does not fix bug 1728062:( The problem is that "mLayersConnected == Some(false)" has the following 2 meanings.

  • [1] parent side does not request to connect layers.
  • [2] parent side requested to connect layers, but the connect was failed.

We need to distinguish between [1] and [2]. And also need to take care crash before InitRendering.

Flags: needinfo?(sotaro.ikeda.g)

Thanks Sotaro. Should we back out my patch and land yours instead?

Flags: needinfo?(sotaro.ikeda.g)

Sorry for my slow reply. It seems not necessary. I am going to create a new bug for the patch soon.

Flags: needinfo?(sotaro.ikeda.g)

Sounds good. thanks!

Attachment #9281815 - Attachment description: Bug 1774201 - Make clear layers connection is requested by parent → Bug 1774201 - Make sure if layers connection is requested by parent
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Attachment #9281815 - Attachment is obsolete: true

I think we should uplift this (and bug 1774815). I'm concerned that due to bug 1768197 users could be left with blank unusable tabs as a result.

Comment on attachment 9281797 [details]
Bug 1774201 - Stop skipping ReinitRendering if previous attempt failed. r?#gfx-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined: Users could be left with blank unusable tabs if they encounter a webrender error when initializing a new tab. The patch from bug 1774815 is also required as this patch alone will regress bug 1728062
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: Bug 1774815
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Ensures we reinitialize the compositor in more circumstances. This was the old behaviour and worked correctly.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9281797 - Flags: approval-mozilla-beta?

Comment on attachment 9281797 [details]
Bug 1774201 - Stop skipping ReinitRendering if previous attempt failed. r?#gfx-reviewers

We are out of the beta cycle and releng is currently merging mozilla-beta to mozilla-release before we build our RC. Morphing this into a release build uplift request.

Attachment #9281797 - Flags: approval-mozilla-beta? → approval-mozilla-release?

Comment on attachment 9281797 [details]
Bug 1774201 - Stop skipping ReinitRendering if previous attempt failed. r?#gfx-reviewers

The impact of the bug in comment #10 looks much more serious to me than the S3 severity set, I am taking it in our RC build, thanks!

Attachment #9281797 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9281797 - Flags: approval-mozilla-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: