Closed Bug 1598585 Opened 6 years ago Closed 6 years ago

Crash in [@ mozilla::gfx::Factory::SetDirect3D11Device]

Categories

(Core :: Graphics, defect, P1)

Unspecified
Windows 10
defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- disabled
firefox73 --- disabled
firefox74 --- disabled
firefox75 --- fixed

People

(Reporter: bobowen, Assigned: bobowen)

References

Details

(Keywords: crash)

Crash Data

Attachments

(5 files)

Looks like a race between the canvas threads and this being created on the main thread.
Also, might be the device failing and being recreated on the canvas thread.

This bug is for crash report bp-d03d8b74-a35b-4357-9c15-5f4df0191122.

Top 10 frames of crashing thread:

0 xul.dll mozilla::gfx::Factory::SetDirect3D11Device gfx/2d/Factory.cpp:816
1 xul.dll mozilla::gfx::DeviceManagerDx::CreateCanvasDevice gfx/thebes/DeviceManagerDx.cpp:305
2 xul.dll mozilla::gfx::DeviceManagerDx::GetCanvasDevice gfx/thebes/DeviceManagerDx.cpp:1141
3 xul.dll static class mozilla::layers::TextureData* mozilla::layers::CreateTextureData gfx/layers/CanvasTranslator.cpp:33
4 xul.dll struct already_AddRefed<mozilla::gfx::DrawTarget> mozilla::layers::CanvasTranslator::CreateDrawTarget gfx/layers/CanvasTranslator.cpp:175
5 xul.dll mozilla::gfx::RecordedDrawTargetCreation::PlayEvent gfx/2d/RecordedEventImpl.h:1803
6 xul.dll static bool mozilla::gfx::RecordedEvent::DoWithEvent<mozilla::gfx::EventRingBuffer> gfx/2d/RecordedEventImpl.h:3586
7 xul.dll mozilla::layers::CanvasTranslator::TranslateRecording gfx/layers/CanvasTranslator.cpp:83
8 xul.dll void mozilla::layers::CanvasParent::StartTranslation gfx/layers/ipc/CanvasParent.cpp:191
9 xul.dll nsresult mozilla::detail::RunnableMethodImpl< xpcom/threads/nsThreadUtils.h:1176

Looks like these are all the canvas thread trying to recreate the device after a device reset.
I think we probably need to:

  • detect that instead of trying to recreate the device
  • notify of device reset for the device to be recreated on the main thread
  • handle any errors and wait for everything to be recreated
  • probably add a critical note at some point

We want to be able to send IPC message from the translation in the parent. So
the simplest thing it move the top level actor parts of CanvasParent into
CanvasTranslator.
This patch also moves the canvas thread management parts out into a new
CanvasThreadHolder class and hopefully makes the lifecycle management of these
much more robust. This includes the use of a TaskQueue per CanvasTranslator to
manage serial processing on the canvas workers, instead of a boolean.

This is generally around object creation failures and their subsequent lookup,
which can happen, for example, during device reset.

Depends on D60887

This sends a message to the content process on device reset/change. The content process clears the CanvasImageCache and canvas TextureClients and the records a
new event, so the translator knows it has finished.

Depends on D60889

Attachment #9122740 - Attachment description: Bug 1598585 Part 1: Make CanvasTranslator the PCanvas parent actor. r=jld! → Bug 1598585 Part 1: Make CanvasTranslator the PCanvas parent actor. r=mattwoodrow!
Pushed by bobowencode@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6b300b00fc72 Part 1: Make CanvasTranslator the PCanvas parent actor. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/95d4eb6763c2 Part 2: Make playback of Moz2D recorded events more robust. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/084d739fe6af Part 3: Detect and handle device reset in CanvasTranslator. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/4ec0aa2e5a72 Part 4: Notify the content process of a canvas device change. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/8ec087144347 Part 5: Create a new reference texture on canvas device change. r=jrmuizel
Regressions: 1618868
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: