Closed Bug 1479175 Opened 6 years ago Closed 6 years ago

Crash in mozilla::layers::IMFYCbCrImage::GetTextureClient

Categories

(Core :: Graphics: WebRender, defect, P1)

63 Branch
ARM64
Windows 10
defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 --- unaffected
firefox63 --- disabled
firefox64 --- fixed

People

(Reporter: philipp, Assigned: sotaro)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is
report bp-62dbd8af-d80a-4b98-92f5-ccbca0180727.
=============================================================

Top 10 frames of crashing thread:

0 xul.dll mozilla::layers::IMFYCbCrImage::GetTextureClient gfx/layers/IMFYCbCrImage.cpp:152
1 xul.dll void mozilla::dom::VideoDecoderParent::ProcessDecodedData dom/media/ipc/VideoDecoderParent.cpp:192
2 xul.dll void mozilla::MozPromise<nsTArray<RefPtr<mozilla::MediaData> >, mozilla::MediaResult, 1>::ThenValue<`lambda at z:/build/build/src/dom/media/ipc/VideoDecoderParent.cpp:162:5', `lambda at z:/build/build/src/dom/media/ipc/VideoDecoderParent.cpp:169:5'>::DoResolveOrRejectInternal xpcom/threads/MozPromise.h:774
3 xul.dll mozilla::MozPromise<RefPtr<mozilla::AudioData>, mozilla::MediaResult, 1>::ThenValueBase::ResolveOrRejectRunnable::Run xpcom/threads/MozPromise.h:411
4 xul.dll mozilla::TaskQueue::Runner::Run xpcom/threads/TaskQueue.cpp:235
5 xul.dll nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1205
6 xul.dll NS_ProcessNextEvent xpcom/threads/nsThreadUtils.cpp:519
7 xul.dll mozilla::ipc::MessagePumpForNonMainThreads::Run ipc/glue/MessagePump.cpp:364
8 xul.dll MessageLoop::RunHandler ipc/chromium/src/base/message_loop.cc:318
9 xul.dll static void nsThread::ThreadFunc xpcom/threads/nsThread.cpp:525

=============================================================

these crashes in the gpu process started showing up in 63.0a1 build 20180725220116 from users on windows 10 with various nvidia graphics cards.
the pushlog to the nightly build before that: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0b9c0b&tochange=02c864

all reports come with MOZ_CRASH(GFX: IMFYCbCrImage timeout) that got added in bug 1223270.
They all seem to have WR+ in "app notes". No one has WR-.
Looking on build dates it could be bug 1478570 (fortunately fixed today)?
Rank: 15
Priority: -- → P2
All crash seems to have "MOZ_CRASH(GFX: IMFYCbCrImage timeout)" as MOZ_CRASH Reason.
 https://dxr.mozilla.org/mozilla-central/source/gfx/layers/d3d11/TextureD3D11.cpp#1872
Component: Audio/Video: Playback → Graphics: WebRender
Assignee: nobody → sotaro.ikeda.g
The issue might be related to Bug 1470386. It enabled recycling of TextureClient. But D3D11Texture2D might not work well on some drivers.
This looks similar to Bug 1418831.
When WebRender is enabled, DXGIYCbCrTextureAllocationHelper::Allocate() always enabled KeyedMutex. It affects to volume of the crash. But the crash also happened for non-WebRender cases.
  https://crash-stats.mozilla.com/report/index/e6170056-5d8b-44ff-9756-b8cc20180809

Bug 1418831 is also another type of the crash.
It seems that there is a case that keyed mutex has not been released yet when DXGIYCbCrTextureData is recycled. I saw the crash only one on my local PC. But I could not reproduce the crash since then. It might be related to the problem of graphics driver.
One solution is to check if keyed mutex of D3D11Texture2D has been released during recycling.
See Also: → 1418831
Attachment #8999869 - Flags: review?(nical.bugzilla)
Blocks: wr-stability
Comment on attachment 8999869 [details] [diff] [review]
patch - check if keyed mutex of D3D11Texture2D has been released during recycling

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

I'm a little worried that quickly grabbing and releasing the DXGI mutex lock might be slow and that since it isn't the intended use of the API it may find obscure driver bugs. That said I could be over-thinking it. I'd rather Bas have a look at this. He'll be away for another couple of days so maybe let's have him do a post landing review if you'd prefer to land this soon (and sorry for the late review I was away last week).
Attachment #8999869 - Flags: review?(nical.bugzilla) → review+
Thanks for the review! I am going to ask bas for review.
Attachment #8999869 - Flags: review?(bas)
Comment on attachment 8999869 [details] [diff] [review]
patch - check if keyed mutex of D3D11Texture2D has been released during recycling

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

This is indeed likely to have some sort of perf impact. But let's wait until we see it show up in practice.
Attachment #8999869 - Flags: review?(bas) → review+
Priority: P2 → P1
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b0e91022e80
check if keyed mutex of D3D11Texture2D has been released during recycling. r=bas
https://hg.mozilla.org/mozilla-central/rev/3b0e91022e80
https://hg.mozilla.org/mozilla-central/rev/d2e77c470ed9
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Regressed by: 1666704

I was looking at a profile of 1080p YouTube playback on gen6 and am seeing the locking in IsCompatbile take up about 8% of the total upload time.

Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: