Closed Bug 1292774 Opened 9 years ago Closed 9 years ago

Intermittent dom/media/tests/mochitest/test_peerConnection_captureStream_canvas_webgl.html | application crashed [@ mozilla::gfx::Log<1,mozilla::gfx::CriticalLogger>::WriteLog(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)]

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox50 --- fixed
firefox51 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: jerry)

References

(Blocks 1 open bug)

Details

(Keywords: intermittent-failure, Whiteboard: [gfx-noted])

Attachments

(1 file)

Looks like WebRTC test waiting for a red pixel to show up severely upset the Gfx folks in this case. Crashes here: https://dxr.mozilla.org/mozilla-central/rev/6b65dd49d4f045c0a9753ce60bdb4b7b4aaedcf8/gfx/2d/Logging.h#510 Therefore I'm guessing this is actually something the Gfx folks should have a look at.
Rank: 35
Priority: -- → P3
Rank: 35
Component: WebRTC → Graphics
Priority: P3 → --
See Also: → 1292785
The failures comes from a D3D11 compositor still in use after a device reset. It's not clear to me when exactly we change the DeviceManager's D3D11 device and whether we are suppose to make sure to replace the compositor beforehand. Could be that we are about to reset the compositor in the next frame, still have a few commands to run on the old one but have already registered a new device in the DeviceManager? Otherwise it means we have a compositor with an outdated device lingering, which should have been replaced. ni? Milan, you added this assertion.
Flags: needinfo?(milan)
Whiteboard: [gfx-noted]
David and Jerry understand these restarts the best these days, but this is usually bad news.
Flags: needinfo?(milan)
Flags: needinfo?(hshih)
Flags: needinfo?(dvander)
If this is new, I wouldn't be surprised if it was tickled by patches on bug 1167235, mostly because of the "trying to lock a TextureHost without a D3D device" message that precedes the assert, and that bug changing some of the timing around locking...
See Also: → 1292976
02:33:00 INFO - [GFX1-]: D3D11 swap chain preset failed 0x887a0005 02:33:00 INFO - [GFX1]: Out of sync D3D11 devices in HandleError, 0 02:33:01 INFO - Assertion failure: [GFX1]: Out of sync D3D11 devices in HandleError, 0, at c:\builds\moz2_slave\m-cen-w64-d-000000000000000000\build\src\obj-firefox\dist\include\mozilla/gfx/Logging.h:509 02:33:13 INFO - #01: mozilla::gfx::Log<1,mozilla::gfx::CriticalLogger>::Flush() [obj-firefox/dist/include/mozilla/gfx/Logging.h:278] 02:33:13 INFO - #02: mozilla::layers::CompositorD3D11::HandleError(long,mozilla::layers::CompositorD3D11::Severity) [gfx/layers/d3d11/CompositorD3D11.cpp:1713] 02:33:13 INFO - #03: mozilla::layers::CompositorD3D11::EndFrame() [gfx/layers/d3d11/CompositorD3D11.cpp:1314] We should update the HandleError(). The d3dswapchain->Present() call could return device_remove/reset error. I think the assert is not necessary.
Assignee: nobody → hshih
Status: NEW → ASSIGNED
Flags: needinfo?(hshih)
Flags: needinfo?(dvander)
(In reply to Jerry Shih[:jerry] (UTC+8) from comment #5) > 02:33:00 INFO - [GFX1-]: D3D11 swap chain preset failed 0x887a0005 0x887a0005 => DXGI_ERROR_DEVICE_REMOVED https://msdn.microsoft.com/zh-tw/library/windows/desktop/bb509553(v=vs.85).aspx
The crash is at compositor thread with: if (mDevice && DeviceManagerD3D11::Get()->GetCompositorDevice() != mDevice) { gfxCriticalError() << "Out of sync D3D11 devices in HandleError, " << (int)mVerifyBuffersFailed; } ----- From refresh driver at main thread, the reset flow paths are: nsRefreshDriver::Tick() gfxPlatform::GetPlatform()->SchedulePaintIfDeviceReset() InvalidateWindowForDeviceReset() // call OnPaint for each window nsWindow::OnPaint() gfxWindowsPlatform::GetPlatform()->UpdateRenderMode(); // re-create d3d and d2d device nsBaseWidget::OnRenderingDeviceReset() CompositorBridgeParent::ResetCompositor() // schedule ResetCompositorTask, and wait it done. Even though the CompositorBridgeParent::ResetCompositor() call is synchronous(ResetCompositor() will update the d3d device in compositor), gecko still can do the composition during UpdateRenderMode(). Then the "DeviceManagerD3D11::Get()->GetCompositorDevice()" might be different from mDevice.
(In reply to Jerry Shih[:jerry] (UTC+8) from comment #8) > Created attachment 8779235 [details] [diff] [review] > turn to use gfxCriticalNote for mismatched d3d11 device in > CompositorD3D11::HandleError(). v1 > > David, what do you think for comment 7? I think we have to change calls like this to be gfxCriticalNotes instead, and make sure our code can handle the undesirable case instead of asserting. I'm not sure this message is worth preserving though. It can always race because we revoke the device without locking the compositor. I don't think we want to change that. So I think it'd be okay to just delete the whole check, but if you'd rather just loosen the assert that's fine too.
Attachment #8779235 - Flags: review?(dvander) → review+
Please land the attachment 8779235 [details] [diff] [review] to m-c. Just a trivial change, so there is no try.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1d1392c28c8d Turn to use gfxCriticalNote for mismatched d3d11 device in CompositorD3D11::HandleError(). r=dvander
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Can you please request approval to land this on Aurora as well?
Flags: needinfo?(hshih)
Comment on attachment 8779235 [details] [diff] [review] turn to use gfxCriticalNote for mismatched d3d11 device in CompositorD3D11::HandleError(). v1 Approval Request Comment [Feature/regressing bug #]: Hit assert like: https://treeherder.mozilla.org/logviewer.html#?job_id=4532526&repo=mozilla-central#L13228 [User impact if declined]: Before this patch, gecko will just hit assert if it is under driver-reset/remove status. This patch try to remove the assert and just show it as a gfx error message in crash report. [Describe test coverage new/current, TreeHerder]: It's already in ff51, and I don't see another crash-report for this assert in ff51. [Risks and why]: Low. For comment 9, it's easy to hit this assertion during driver remove/reset. And gecko will handle the driver remove/reset in other path. Maybe we could just remove this assertion, but I still like to preserve this information. So, this patch try to use gfxCriticalNote instead of gfxCriticalError. gfxCriticalNote will just show the message in crash-report without assert. [String/UUID change made/needed]: none
Flags: needinfo?(hshih)
Attachment #8779235 - Flags: approval-mozilla-aurora?
Comment on attachment 8779235 [details] [diff] [review] turn to use gfxCriticalNote for mismatched d3d11 device in CompositorD3D11::HandleError(). v1 Fixes an intermittent failure, has been on Nightly for over a month, Aurora50+
Attachment #8779235 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Blocks: 1297204
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: