tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2374da507a9bd441d4dcff49d66a03132e23e565
parent 796486a95674beffa5b1ac9f072a11524dca9beb
Author: Greg Stoll <gstoll@mozilla.com>
Date:   Mon,  6 Oct 2025 11:18:30 +0000

Bug 1947324 part 6 - avoid using Windows App SDK on opt-talos-xperf runs r=bobowen,perftest-reviewers,kshampur

On opt-talos-xperf, the Windows App SDK fails
calling DCompositionCreateDevice3() with ERROR_ACCESS_DENIED,
and the code assumes it is going to succeed so it proceeds to crash
deferencing null.

We haven't seen this crash anywhere else, and so I suspect this has
something to do with the way Firefox is being run there. So add a pref
to turn off using the Windows App SDK for just this test.

If this turns out to cause crashes in other situations, we should figure
out what the situation is and try to fix it.

Differential Revision: https://phabricator.services.mozilla.com/D267040

Diffstat:
Mmodules/libpref/init/StaticPrefList.yaml | 10++++++++++
Mtaskcluster/kinds/test/talos.yml | 5+++++
Mwidget/windows/WindowsUIUtils.cpp | 16++++++++++++++++
3 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml @@ -19332,6 +19332,16 @@ type: RelaxedAtomicInt32 value: 0 mirror: always + +# Whether to use the Windows App SDK to disable the minimize/maximize/close buttons. +# This should only be disabled if crashes are happening, because it will make +# double minimize/maximize/close buttons draw. Note that this preference is disregarded +# when running on Windows 11 H2 or earlier (which includes Windows 10), as we never use +# the Windows App SDK on those versions. +- name: widget.windows.windowsappsdk.enabled + type: bool + value: true + mirror: always #endif # Whether to disable SwipeTracker (e.g. swipe-to-nav). diff --git a/taskcluster/kinds/test/talos.yml b/taskcluster/kinds/test/talos.yml @@ -717,6 +717,11 @@ talos-xperf: # running xperf as an administrator which cause us to fail # due to generating minidumps. - --setpref=layers.gpu-process.enabled=false + # On these runs in particular, the Windows App SDK crashes + # when initializing because DCompositionCreateDevice3() + # fails with ERROR_ACCESS_DENIED. This only seems to happen + # on this kind of run, so disable the Windows App SDK. + - --setpref=widget.windows.windowsappsdk.enabled=false default: - --suite=xperf config: diff --git a/widget/windows/WindowsUIUtils.cpp b/widget/windows/WindowsUIUtils.cpp @@ -1318,6 +1318,22 @@ void WindowsUIUtils::SetIsTitlebarCollapsed(HWND aWnd, bool aIsCollapsed) { ("Skipping SetIsTitlebarCollapsed() because mica is not available")); return; } + // This pref is only false on certain test runs (most notably + // opt-talos-xperf), the Windows App SDK fails calling + // DCompositionCreateDevice3() with ERROR_ACCESS_DENIED, and the code assumes + // it is going to succeed so it proceeds to crash deferencing null. + // + // We're not exactly sure why this is happening right now, but I'm pretty sure + // it's specific to how we're running Firefox on those test runs, and + // I don't think any users will run into this. So those tests pass the + // --disable-windowsappsdk command line argument to avoid using + // the Windows App SDK. + if (!StaticPrefs::widget_windows_windowsappsdk_enabled()) { + MOZ_LOG(gWindowsLog, LogLevel::Info, + ("Skipping SetIsTitlebarCollapsed() because " + "widget.windows.windowsappsdk.enabled is false")); + return; + } if (!InitializeWindowsAppSDKStatics()) { return; }