fix: stop GetMaximumSize returning INT_MAX if max size not set OS-21471 - #151
Merged
t-bashir-bs merged 1 commit intoJul 9, 2026
Merged
Conversation
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.
caneraltinbasak
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
npm testpassesRelease Notes
Notes: