core: Do not abort on overflowing window positions in edge resistance - #861
Open
ArekMiszcz wants to merge 1 commit into
Open
core: Do not abort on overflowing window positions in edge resistance#861ArekMiszcz wants to merge 1 commit into
ArekMiszcz wants to merge 1 commit into
Conversation
A native Wayland Chrome window restored maximized can end up with a frame rect x near INT_MAX. Computing resistance edges then overflows BOX_RIGHT, split_edge's assertion fails and cinnamon aborts, killing every client. Skip windows whose frame rect is outside a sane range and keep an edge unsplit instead of asserting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
|
Did you test your change on master to validate it? |
Author
Yes, now on master (03106ef) as well. The crash path is unchanged on master, so I reproduced it there directly: a small program built against a master build tree calls
What I could not do is run the whole compositor from master in a session, because my desktop is Cinnamon 6.4 (Debian 13). The runtime testing of the full change, including skipping such windows in edge resistance, was done on the 6.4.1 backport. |
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.
Problem
In a Wayland session, cinnamon aborts while the user drags any window:
Every Wayland client and Xwayland go down with it, so all windows disappear.
Backtrace from the core dump (muffin 6.4.1, Debian 13):
Cause
One of the obscuring windows was a native Wayland Google Chrome window (its previous session was maximized) with
unconstrained_rect = (2147482260, 100, 1876x996), i.e. INT_MIN − 1388 after wrapping; itssaved_rect.xwas INT_MIN. When that rect is used to split resistance edges,BOX_RIGHT()overflows,rectangle_and_edge_intersection()reports an overlap thatmeta_rectangle_horiz_overlap()then rejects, and the assertion insplit_edge()fires.The bogus position itself most likely comes from the early-maximize handling that master has since reworked (a85a711, d4a6c96), but edge resistance should not take the whole session down, whatever position a client ends up with.
Fix
split_edge(), keep the edge unsplit and warn once instead of asserting when the edge and the removal rectangle do not overlap.Testing
boxes.candedge-resistance.ccompile without warnings.🤖 Generated with Claude Code