Repository navigation
Popovers never outlive their parent (crash in gtk_widget_unparent) - #89
Open
marcin-koziol wants to merge 1 commit into
Open
marcin-koziol wants to merge 1 commit into
marcin-koziol wants to merge 1 commit into
Conversation
A popover was unparented in an idle callback after it closed. When its parent went while it was open — the plugin browser's category row, with the sidebar rebuilt by a favourite, a plugin check or a rescan — the popover kept pointing at the freed row, and gtk_widget_unparent crashed (SIGSEGV in the idle callback, from plugin_browser's ask_name). canvas::attach_popover parents a transient popover for as long as it is shown: unparented once it closes, or right when its parent is destroyed, whichever comes first; the idle then finds nothing to do. Every popover the shell parents by hand uses it: the canvas menus and text prompts, the plugin browser's name prompt, MIDI learn, the toggles' submenus and the plugin window's parameter menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What happened
FaderFrame crashed with SIGSEGV in the main loop. The stack ran through an idle callback into
gtk_widget_unparent, and the callback was the oneplugin_browser::ask_namequeues for its popover (symbolized from a release build with debug info):Cause
Popovers the shell parents by hand were unparented in an idle callback after they closed. The plugin browser's name prompt is parented to a category row in the sidebar, and the sidebar is rebuilt when favourites change, a plugin check finishes or a rescan completes. When that happened while the prompt was open, the row was freed and the popover kept pointing at it, so unparenting it later crashed GTK.
Fix
canvas::attach_popoverparents a transient popover for as long as it is shown. It unparents the popover once it closes, or immediately when the parent is destroyed, whichever comes first, so the idle callback then finds nothing to do.Every popover the shell parents by hand now uses it:
Popovers in the Windows crash reports (IME code reached during a menu popup or a dock tab click) are created on the same paths. This change may help there too, but that is not verified.
Tests
a_popover_outlives_its_parent_row_safely(an--ignoredGTK test, like the other display tests infaderframe-ui): the popover's parent row is removed while the popover is open; the popover is then closed and the main loop run.parent()returns the freed row and the test fails there.clippy -D warningsonfaderframe-uiis clean, and so isfmt --check.🤖 Generated with Claude Code