After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761106 - symbol-tree plugin crashes builder when disabling it
symbol-tree plugin crashes builder when disabling it
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-25 23:07 UTC by Mario Sánchez Prada
Modified: 2016-01-26 09:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Full backtrace (20.94 KB, text/plain)
2016-01-25 23:07 UTC, Mario Sánchez Prada
  Details
Patch proposal (26.52 KB, patch)
2016-01-25 23:36 UTC, Mario Sánchez Prada
none Details | Review
Patch proposal (26.52 KB, patch)
2016-01-25 23:45 UTC, Mario Sánchez Prada
committed Details | Review

Description Mario Sánchez Prada 2016-01-25 23:07:59 UTC
Created attachment 319707 [details]
Full backtrace

Disabling the system-tree extension results in a crash due to a mishandled situation with the ref count of the extension, which should be a GObject instead of a GtkWidget, resulting in a backtrace like this one:

  • #0 _gtk_widget_get_realized
    at gtkwidgetprivate.h line 344
  • #1 gtk_widget_dispose
    at gtkwidget.c line 12025
  • #2 gtk_box_dispose
    at gtkbox.c line 244
  • #3 g_object_unref
    at gobject.c line 3146
  • #4 remove_extension_item
    at peas-extension-set.c line 236
  • #5 remove_extension
    at peas-extension-set.c line 255

Mentioned this on IRC yesterday and got a quick reply from Christian:

<hergertme> 07:20:15> msanchez, symbol tree is almost guaranteed to crash, because the extension inherits from GtkWidget, so the reference counting is broken (since extensions are expected to be GObject, and not floating)

<hergertme> 07:20:57> msanchez, i thought i didn't allow disabling on it, but essentially the fix is to make a workbench addin object, that then creates a Symbol tree panel, and adds it to the workbench. that way the extension object is a regular gobject

Reporting this bug to track down the issue, and a possible patch for it
Comment 1 Mario Sánchez Prada 2016-01-25 23:36:33 UTC
Created attachment 319708 [details] [review]
Patch proposal

See attached a patch implementing the proposal approach.

Let me know what you think, thanks!
Comment 2 Mario Sánchez Prada 2016-01-25 23:45:31 UTC
Created attachment 319710 [details] [review]
Patch proposal

I uploaded the wrong patch it seems (wrong commit log). This is the one to review, sorry for the confusion!
Comment 3 Christian Hergert 2016-01-26 03:11:55 UTC
Thanks so much for doing this! You're on a roll.
Comment 4 Mario Sánchez Prada 2016-01-26 09:39:54 UTC
No problem, happy to help.