Closed Bug 1827222 Opened 2 years ago Closed 2 years ago

Check for shutdown while waiting for GPU process launch

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Crash Data

Attachments

(1 file)

We have evidence that we try to resetup the GPU process during shutdown:
https://crash-stats.mozilla.org/report/index/fbfe5ff2-edaa-436b-9ebd-c3f020230409#tab-details

It appears that we do check for shutdown before launching the process:
https://searchfox.org/mozilla-central/rev/b9d6a9ab5cea31c8bcdf99541b02c1a2fca0daf8/gfx/ipc/GPUProcessManager.cpp#201

But between the process being launched and before we block the main thread on waiting for it to finish:
https://searchfox.org/mozilla-central/rev/b9d6a9ab5cea31c8bcdf99541b02c1a2fca0daf8/gfx/ipc/GPUProcessHost.cpp#86

Then we may have shutdown. We should probably check again in EnsureGPUReady before re-initializing everything.

See Also: → 1649857

This is a bit complicated to fix because every instance of GPUProcessManager::EnsureGPUReady needs to now return multiple error codes. NS_OK for there is a GPU process, NS_ERROR_NOT_AVAILABLE for use the parent process, and NS_ERROR_ILLEGAL_DURING_SHUTDOWN for if it is called in the middle of shutdown. Or something equivalent.

We already avoid launching the GPU process during shutdown, but shutdown
could happen after we initiated the launch and before it completes. Top
level IPDL protocols assert that we don't create them during shutdown,
so we need to be more diligent about checking for that.

Crash Signature: [@ mozilla::ipc::CreateEndpoints ] → [@ mozilla::ipc::CreateEndpoints ] [@ shutdownhang | mozilla::ipc::MessageChannel::WaitForSyncNotify | mozilla::ipc::MessageChannel::Send | mozilla::ipc::IProtocol::ChannelSend | mozilla::gfx::PGPUChild::SendGetDeviceStatus ]
Crash Signature: [@ mozilla::ipc::CreateEndpoints ] [@ shutdownhang | mozilla::ipc::MessageChannel::WaitForSyncNotify | mozilla::ipc::MessageChannel::Send | mozilla::ipc::IProtocol::ChannelSend | mozilla::gfx::PGPUChild::SendGetDeviceStatus ] → [@ mozilla::ipc::CreateEndpoints ] [@ shutdownhang | mozilla::ipc::MessageChannel::WaitForSyncNotify | mozilla::ipc::MessageChannel::Send | mozilla::ipc::IProtocol::ChannelSend | mozilla::gfx::PGPUChild::SendGetDeviceStatus ] [@ shutdownhang | mozilla::…

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:aosmond, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(jnicol)
Flags: needinfo?(aosmond)
Flags: needinfo?(jnicol)

Try keeps failing. It is probably fine.

Pushed by nerli@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/028514f49809 GPUProcessManager should not allow (re)initialization during shutdown. r=jnicol
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
See Also: → 1880845
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: