Skip to content

fix: guard tree rendering against destroyed window actors#507

Open
braceyourself wants to merge 1 commit intoforge-ext:mainfrom
braceyourself:fix/guard-destroyed-window-actors
Open

fix: guard tree rendering against destroyed window actors#507
braceyourself wants to merge 1 commit intoforge-ext:mainfrom
braceyourself:fix/guard-destroyed-window-actors

Conversation

@braceyourself
Copy link

Got kicked out of my entire GNOME session on Feb 20. No warning, just landed on an error page with a "log out" button.

  1. journalctl -b 0 told the story: signal 11 (SIGSEGV) in gnome-shell, then signal 6 (mutter assertion) right behind it. A double crash.
  2. Signal 11 pointed at the Forge extension. Signal 6 was just mutter reacting to the mess.
  3. Traced it into tree.js - the recursive processNode() traversal, line 1555.
  4. Reproduced it: open a few windows in tabbed layout, kill -9 one of them, watch gnome-shell die on the next render cycle.
  5. The smoking gun was 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 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.

Tested by opening 3 windows in tabbed layout, kill -9ing one, and confirming gnome-shell stayed up with no SIGSEGV or forge errors in journalctl.

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.
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.

1 participant