Sync downstream fix: prevent crash from stale fullscreen pointer in overview mode#9014
Open
anonymous0719 wants to merge 1 commit intoswaywm:masterfrom
Open
Sync downstream fix: prevent crash from stale fullscreen pointer in overview mode#9014anonymous0719 wants to merge 1 commit intoswaywm:masterfrom
anonymous0719 wants to merge 1 commit intoswaywm:masterfrom
Conversation
…iner When a fullscreen container is destroyed while in overview mode, the workspace layout may still keep a stale fullscreen pointer, leading to invalid memory access and crashes when exiting overview. This change clears the fullscreen reference if the destroyed container is the one stored in the overview layout, preventing use-after-free and crash scenarios.
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.
Background
We are developing a research tool that scans downstream forks to identify valuable commits
that have not yet been merged back into upstream projects.
The goal is to help upstream maintainers discover useful fixes that may otherwise remain
isolated in forks.
During this process, we found this commit in a downstream fork, and it has already been
validated and merged there.
What this change does
This commit fixes a crash that occurs when a fullscreen container is destroyed while the
system is in overview mode.
Root cause
When a fullscreen container is closed in overview mode, the workspace layout may still keep
a reference to that container in
layout.fullscreen.This creates a stale (dangling) pointer, which can later be dereferenced when exiting
overview mode, leading to a crash.
Fix
The patch explicitly clears the fullscreen reference when:
This prevents stale pointers and avoids invalid memory access.
Why this matters
This issue is:
The fix is minimal, safe, and localized, and has already been proven in a downstream fork.
Additional context
This PR is part of our effort to upstream valuable downstream contributions discovered via
our analysis tool.
All commits are manually reviewed and technically validated before submission.
We hope this contribution is helpful.
If there are any concerns about the change itself or suggestions on how our tool or workflow
could be improved, we would greatly appreciate your feedback.
Related issue: #125
Downstream reference commit: f42701e