fix: guard tree rendering against destroyed window actors#507
Open
braceyourself wants to merge 1 commit intoforge-ext:mainfrom
Open
fix: guard tree rendering against destroyed window actors#507braceyourself wants to merge 1 commit intoforge-ext:mainfrom
braceyourself wants to merge 1 commit intoforge-ext:mainfrom
Conversation
If a window gets destroyed mid-render (app crash, rapid close, async cleanup), nodes in the tree still reference the finalized GObject. Accessing anything on it segfaults gnome-shell (signal 11). Adds isNodeValid() that probes the actor with get_name() in a try/catch (GJS throws on finalized GObjects rather than segfaulting). Filters dead nodes out before layout, and guards the remaining property accesses that can race with window destruction.
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.
Got kicked out of my entire GNOME session on Feb 20. No warning, just landed on an error page with a "log out" button.
journalctl -b 0told the story: signal 11 (SIGSEGV) in gnome-shell, then signal 6 (mutter assertion) right behind it. A double crash.tree.js- the recursiveprocessNode()traversal, line 1555.kill -9one of them, watch gnome-shell die on the next render cycle.child.actor.border.get_theme_node()accessing a dead window's actor. The render pipeline just assumes everything is alive. GJS doesn't stop you from touching a finalized GObject - it lets the access through to C, and C doesn't ask twice.Adds
isNodeValid()that probes the actor withget_name()in a try/catch (GJS throws on finalized GObjects rather than segfaulting). Filters dead nodes out before layout, and guards the remaining property accesses that can race with window destruction.Tested by opening 3 windows in tabbed layout,
kill -9ing one, and confirming gnome-shell stayed up with no SIGSEGV or forge errors injournalctl.