Crash in nsWindow::TryDwmResizeHack when a window opened with sizemode="fullscreen" is the session's first fullscreen entry
Categories
(Core :: Widget: Win32, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
On Windows 11, when the first fullscreen entry of the session comes from a XUL window opened with sizemode="fullscreen", the window goes fullscreen from AppWindow::BeforeStartLayout, before any renderer exists. The heuristics in nsWindow::TryDwmResizeHack then dereference the null mWindowRenderer. That is a null-deref crash in opt builds and a MOZ_ASSERT in debug builds.
It reproduces every time with https://tests.firefox.dev/test.html?test=dom/base/test/fullscreen/test_fullscreen.xhtml in the windows11 mochitest-chrome-standalone jobs, which restart the browser before each test. Those jobs currently skip the test (the skip was added in bug 2026600).
The fix skips the hack for a window that has no renderer yet, before the one-shot sIsFirstFullscreenEntry flag is used up, so the hack still applies to the next fullscreen entry. This assumes such a window cannot hit the DWM bug, which targets maximized windows going fullscreen.
| Assignee | ||
Comment 1•29 days ago
|
||
When a window opened with sizemode="fullscreen" is the session's first fullscreen entry on Windows 11, nsWindow::TryDwmResizeHack dereferences a null mWindowRenderer, crashing on a null deref in opt and on a MOZ_ASSERT in debug.
The hack targets maximized windows going fullscreen; such a window was never shown maximized. Returning before sIsFirstFullscreenEntry is consumed keeps the hack for the next fullscreen entry. The early return also applies when widget.windows.apply_dwm_resize_hack forces the hack.
This removes the Windows standalone skip of test_fullscreen.xhtml added in bug 2026600.
Updated•29 days ago
|
Comment 3•24 days ago
|
||
| bugherder | ||
Updated•17 days ago
|
Description
•