Skip to content

fix: stop GetMaximumSize returning INT_MAX if max size not set OS-21471 - #151

Merged
t-bashir-bs merged 1 commit into
42-x-y-bsfrom
tbashir/42-x-y-bs-fix-roelectron-crashes-OS-21471
Jul 9, 2026
Merged

fix: stop GetMaximumSize returning INT_MAX if max size not set OS-21471#151
t-bashir-bs merged 1 commit into
42-x-y-bsfrom
tbashir/42-x-y-bs-fix-roelectron-crashes-OS-21471

Conversation

@t-bashir-bs

Copy link
Copy Markdown

Description of Change

Carson test electron-tests is failing on series 6 devices most of the time and sometimes on series 5 devices in SkBitmap::allocPixels. The crash is because the height is set to 8388608, which would require ~12 GB of RAM.

The error is caused by a fix added for windows to
NativeFrameView::GetMaximumSize(). The code returns gfx::Size(INT_MAX, INT_MAX) as a sentinel when no maximum window size is set. INT_MAX propagates through
SizeWithDecorations() and AdjustBoundsToConstraintsDIP() arithmetic, overflowing signed 32-bit integers to ~0x800000 (~8388608). Under a Wayland configure race (compositor sends width=N, height=0 while client is mid-layout), the Views framework briefly applies this overflowed value as the actual window bounds.

The HWNDMessageHandler::SetAspectRatio comment justifying INT_MAX was Windows-only and does not apply to Ozone Wayland builds.

Checklist

Release Notes

Notes:

Carson test electron-tests is failing on series 6 devices most of the
time and sometimes on series 5 devices in SkBitmap::allocPixels.
The crash is because the height is set to 8388608, which would
require ~12 GB of RAM.

The error is caused by a fix added for windows to
NativeFrameView::GetMaximumSize(). The code returns
gfx::Size(INT_MAX, INT_MAX) as a sentinel when no maximum
window size is set.  INT_MAX propagates through
SizeWithDecorations() and AdjustBoundsToConstraintsDIP() arithmetic,
overflowing signed 32-bit integers to ~0x800000 (~8388608).  Under a
Wayland configure race (compositor sends width=N, height=0 while
client is mid-layout), the Views framework briefly applies this
overflowed value as the actual window bounds.

The HWNDMessageHandler::SetAspectRatio comment justifying INT_MAX was
Windows-only and does not apply to Ozone Wayland builds.
@t-bashir-bs
t-bashir-bs merged commit 7c9b6cf into 42-x-y-bs Jul 9, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants