Closed Bug 967505 Opened 6 years ago Closed 6 years ago

TextureClientD3D11 sometimes crash in its destructor

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: nical, Assigned: nical)

Details

Attachments

(1 file, 1 obsolete file)

Destroying the texture's DrawTarget sometimes trigger some code inside D2D that tries to access the underlying D3D texture which is inaccessible (and crashes). We need to make sure that the surface is accessible when that happens.
Comment on attachment 8370053 [details] [diff] [review]
Ensure that the texture is accessible when the draw target gets destroy

Review of attachment 8370053 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/d3d11/TextureD3D11.cpp
@@ +154,5 @@
> +  if (mDrawTarget) {
> +    MOZ_ASSERT(!mIsLocked);
> +    MOZ_ASSERT(mTexture);
> +    MOZ_ASSERT(mDrawTarget->refcount() == 1);
> +    // DrawTarget's dtor may trigger code paths that want to access the texture

Hrm, it shouldn't as long as we just flush is every time we unlock..?
We already do flush on unlock.
The code that crashes in ~DrawTargetD2D is mRT->EndDraw() which is called regardless of flush, but doesn't always crash (I have hit the crash very rarely).
http://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetD2D.cpp#185
(In reply to Nicolas Silva [:nical] from comment #3)
> We already do flush on unlock.
> The code that crashes in ~DrawTargetD2D is mRT->EndDraw() which is called
> regardless of flush, but doesn't always crash (I have hit the crash very
> rarely).
> http://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetD2D.cpp#185

We need to figure out how drawing commands ended up in the buffer. I worry the cost of this change is too high.
Attachment #8372354 - Flags: review?(bas) → review+
https://hg.mozilla.org/mozilla-central/rev/542f9093ec36
https://hg.mozilla.org/mozilla-central/rev/5741926de900
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.