Crash in [@ gfxWindowsPlatform::EnsureDevicesInitialized] MOZ_DIAGNOSTIC_ASSERT(!IsWin32kLockedDown())
Categories
(Core :: Graphics, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr153 | --- | unaffected |
| firefox159 | --- | disabled |
| firefox160 | --- | disabled |
| firefox161 | --- | disabled |
| firefox162 | --- | fixed |
People
(Reporter: clouseau-bot, Assigned: bobowen)
References
(Blocks 1 open bug)
Details
(Keywords: crash)
Crash Data
Attachments
(1 external file)
Crash report: https://crash-stats.mozilla.org/report/index/8bcf2471-0900-43c3-ad40-9f1820261103
MOZ_CRASH Reason:
MOZ_DIAGNOSTIC_ASSERT(!IsWin32kLockedDown())
Top 10 frames:
0 xul.dll gfxWindowsPlatform::EnsureDevicesInitialized() gfx/thebes/gfxWindowsPlatform.cpp:1476
1 xul.dll mozilla::layers::WebRenderBridgeChild::GetForMedia() gfx/layers/wr/WebRenderBridgeChild.cpp:547
2 xul.dll mozilla::dom::MediaCapabilities::GetCompositor() dom/media/mediacapabilities/MediaCapabilities.cpp:1833
3 xul.dll mozilla::dom::MediaCapabilities::CreateNonWebRTCDecodingInfo(mozilla::dom::Media... dom/media/mediacapabilities/MediaCapabilities.cpp:1160
4 xul.dll mozilla::dom::MediaCapabilities::CreateMediaCapabilitiesDecodingInfo(mozilla::do... dom/media/mediacapabilities/MediaCapabilities.cpp:995
5 xul.dll mozilla::dom::MediaCapabilities::DecodingInfo(mozilla::dom::MediaDecodingConfigu... dom/media/mediacapabilities/MediaCapabilities.cpp:930
6 xul.dll mozilla::dom::MediaCapabilities_Binding::decodingInfo_promiseWrapper(JSContext*,... dom/bindings/MediaCapabilitiesBinding.cpp:1498
7 xul.dll mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::Normal... dom/bindings/BindingUtils.cpp:3218
8 xul.dll js::Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:3292
9 xul.dll js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvoke... js/src/vm/Interpreter.cpp:736
There is 1 crash in nightly 161 with buildid 20261103080110.
In the last 30 days, Firefox has 9 crashes (from 4 installations) on nightly and 5 crashes (from 2 installations) on beta/DevEdition with this signature.
This signature has been reported since build 20190507012018 (2019-05-07), 2737 days before the build above.
This bug looks actionable because:
-
MOZ_DIAGNOSTIC_ASSERT(!IsWin32kLockedDown())ingfxWindowsPlatform::EnsureDevicesInitializedfires. A win32k-locked-down content process reached it fromWebRenderBridgeChild::GetForMediabecausePDMFactory::AllDecodersAreRemote()returned false.- At startup the parent decides content win32k lockdown in
GetLiveWin32kLockdownState(), refusing it (DecodersArentRemote) unlessPDMFactory::AllDecodersAreRemote()is true, and caches the result ingWin32kStatus. AllDecodersAreRemote()reads sixmedia.rdd-*static prefs that are live (mirror: always), and the cached lockdown state is only recomputed forsecurity.sandbox.content.win32k-disable.- In this locked-down content process, a page script called
MediaCapabilities.decodingInfo(), which goes throughMediaCapabilities::GetCompositor()intoWebRenderBridgeChild::GetForMedia(). - There
AllDecodersAreRemote()returned false, probably because one of themedia.rdd-*prefs changed after the lockdown decision, soGetForMediacalledEnsureDevicesInitialized()(line 547). EnsureDevicesInitialized()asserts that the process is not win32k-locked-down, and the assert fails (line 1476).
Frame 1 at line 547 is inside the
!AllDecodersAreRemote()branch, and the crash reason is this exact assert, so both conditions held in this process. What made the predicate false after lockdown (a user pref change or another path) is not visible in the report. The owner should first look at whetherGetForMediashould checkIsWin32kLockedDown()(or the parent's cached decision) instead of the live decoder prefs. - At startup the parent decides content win32k lockdown in
-
The failing code was last changed in 6b30d87e0b90 (bug 1692894) by :bobowen, which landed on 2021-02-25; this signature is also reported on builds made before that date.
Impact
A content process crashes; the tabs it hosts show a crash page. MOZ_DIAGNOSTIC_ASSERT is in nightly and Developer Edition builds only; beta, release and ESR builds run on past it. In beta and release the assert is skipped, so EnsureDevicesInitialized() goes on to run InitializeDevices() and UpdateBackendPrefs() once, trying to create D3D devices in a process where win32k system calls are blocked.
Possible fixes
- In
WebRenderBridgeChild::GetForMedia, skipEnsureDevicesInitialized()whenIsWin32kLockedDown()is true, since a locked-down process cannot use local D3D devices anyway. - Have
GetForMediaand the lockdown decision use the same snapshot, for example by cachingAllDecodersAreRemote()at content-process launch, so latermedia.rdd-*pref changes cannot split them. - Possibly make the
media.rdd-*prefs used byAllDecodersAreRemote()mirror: once, or recomputegWin32kStatuswhen they change, so new content processes are not launched locked down with non-remote decoders.
How to confirm
On a Windows nightly with content win32k lockdown on, open a page, then set media.rdd-vpx.enabled (or another media.rdd-* pref) to false in about:config and call navigator.mediaCapabilities.decodingInfo({type:'file', video:{contentType:'video/webm; codecs="vp9"', width:640, height:360, bitrate:1000000, framerate:30}}) from that tab. The diagnostic assert should fire.
Code references:
- mozilla::layers::WebRenderBridgeChild::GetForMedia
- gfxWindowsPlatform::EnsureDevicesInitialized
- mozilla::PDMFactory::AllDecodersAreRemote
- GetLiveWin32kLockdownState
:bobowen, can you have a look please?
Filed automatically by Clouseau with an LLM, from a submitted crash report: not an independent Mozilla discovery
Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.
This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.
Updated•26 days ago
|
| Assignee | ||
Updated•24 days ago
|
| Assignee | ||
Comment 1•20 days ago
|
||
| Assignee | ||
Comment 2•20 days ago
|
||
Decoders in these processes never use the devices: DXVA is only used in the RDD
and GPU processes. Initializing them could hit the win32k lockdown assertion
when a media.rdd-* pref was changed after startup.
Comment 4•13 days ago
|
||
| bugherder | ||
Comment 5•13 days ago
|
||
The patch landed in nightly and beta is affected.
:bobowen, please make an uplift decision for beta:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox161towontfixif the fix can wait for the next release.
Uplift requests can be submitted from Lando: D341315.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
Updated•13 days ago
|
Updated•13 days ago
|
Updated•4 days ago
|
Description
•