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 710783 - Crash when opening a Glade file
Crash when opening a Glade file
Status: RESOLVED DUPLICATE of bug 705745
Product: glade
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-24 09:06 UTC by s.mehrbrodt
Modified: 2013-11-26 23:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Glade file from LibreOffice (17.20 KB, application/x-designer)
2013-10-24 09:06 UTC, s.mehrbrodt
  Details
BrowserWindow.ui from titania (97.83 KB, application/xml)
2013-10-26 10:39 UTC, Holger Seelig
  Details
Backtrace opening slidetransitionspanel.ui (12.88 KB, text/plain)
2013-10-26 13:09 UTC, s.mehrbrodt
  Details
Proposed Patch (778 bytes, patch)
2013-11-02 15:47 UTC, s.mehrbrodt
none Details | Review

Description s.mehrbrodt 2013-10-24 09:06:55 UTC
Created attachment 257992 [details]
Glade file from LibreOffice

Glade crashes when I open the attached file.
Versions: Glade 3.14.2/Ubuntu 13.10


Here's the output:
samuel@samuel-terra:~/programming/libreoffice$ glade -v sd/uiconfig/simpress/ui/slidetransitionspanel.ui 

(glade:14267): Gtk-CRITICAL **: gtk_recent_chooser_set_filter: assertion 'GTK_IS_RECENT_FILTER (filter)' failed
GladeUI-Message: No displayable values for property GtkEntry::input-purpose
GladeUI-Message: No displayable values for property GtkEntry::input-hints
GladeUI-Message: No displayable values for property GtkTextView::input-purpose
GladeUI-Message: No displayable values for property GtkTextView::input-hints
GladeUI-Message: 1 missing displayable value for GtkCellRendererAccel::accel-mode

(glade:14267): GladeUI-CRITICAL **: glade_widget_adaptor_get_object_type: assertion 'GLADE_IS_WIDGET_ADAPTOR (adaptor)' failed

(glade:14267): GladeUI-CRITICAL **: glade_widget_set_object: assertion 'new_object == NULL || g_type_is_a (G_OBJECT_TYPE (new_object), glade_widget_adaptor_get_object_type (gwidget->priv->adaptor))' failed

(glade:14267): GladeUI-ERROR **: Unable to get GladeWidget for internal child selection

Trace/Breakpoint ausgelöst (Speicherabzug geschrieben)
Comment 1 Juan Pablo Ugarte 2013-10-24 18:01:42 UTC
I can not reproduce it on Debian version 3.14.2 nor on master

Try getting a backtrace in the first glade_widget_adaptor_get_object_type() assertion.
Comment 2 s.mehrbrodt 2013-10-24 21:20:09 UTC
How do I get that backtrace?
Comment 3 Juan Pablo Ugarte 2013-10-25 18:06:55 UTC
Well, you need to install glade debug package if that exists or recompile with --enable-debug then use gdb to run it and break in g_log() before loading the ui file
Comment 4 Holger Seelig 2013-10-26 10:38:06 UTC
I can reproduce this crash on my Ubuntu 13.10 and have the same bug with the file OutlineEditor.ui

This bug seems to be related to bug https://bugzilla.redhat.com/show_bug.cgi?id=973277.

Glade does not understand the attribute "internal-child" as shown below:

  <object class="GtkDialog" id="FileSaveWarningDialog">
    <child internal-child="vbox">
    </child>
  </object>

I think it is very anti-social to produce files that cannot be opened in a future version of this program.
Comment 5 Holger Seelig 2013-10-26 10:39:07 UTC
Created attachment 258166 [details]
BrowserWindow.ui from titania
Comment 6 s.mehrbrodt 2013-10-26 13:09:28 UTC
Created attachment 258174 [details]
Backtrace opening slidetransitionspanel.ui
Comment 7 s.mehrbrodt 2013-10-26 13:10:57 UTC
Hope this backtrace is helpful. I put a breakpoint in "g_log()" and this is the output of "backtrace full" after loading the file.
Comment 8 Juan Pablo Ugarte 2013-10-27 18:56:58 UTC
(In reply to comment #4)
> I can reproduce this crash on my Ubuntu 13.10 and have the same bug with the
> file OutlineEditor.ui
> 
> This bug seems to be related to bug
> https://bugzilla.redhat.com/show_bug.cgi?id=973277.

Seems like it but it is not, the problem is that GtkBox is not instantiable in gtk2 but it is in gtk3, so when glade tries to create an instance glib aborts.

Btw this bug is fixed in glade-3-8 branch

> Glade does not understand the attribute "internal-child" as shown below:
> 
>   <object class="GtkDialog" id="FileSaveWarningDialog">
>     <child internal-child="vbox">
>     </child>
>   </object>
> 
> I think it is very anti-social to produce files that cannot be opened in a
> future version of this program.

Pointing fingers is worst IMHO, in any case this is a bug and as with most bugs, was not intended!
Comment 9 Juan Pablo Ugarte 2013-10-27 19:10:41 UTC
(In reply to comment #7)
> Hope this backtrace is helpful. I put a breakpoint in "g_log()" and this is the
> output of "backtrace full" after loading the file.

this is weird, the backtrace suggest 
glade_widget_adaptor_get_by_name ("GtkTreeSelection") returns something that is not a GladeWidgetAdaptor

see glade_widget_read() code

          if ((adaptor = glade_widget_adaptor_get_by_name (klass)) &&
              (type = glade_widget_adaptor_get_object_type (adaptor)) &&
              G_TYPE_IS_INSTANTIATABLE (type) &&
              G_TYPE_IS_ABSTRACT (type) == FALSE)

The only think I can think of is that the adaptor is getting unreffed for some reason, so if you can, try adding a reference in glade_widget_adaptor_register()
by adding a g_object_ref (adaptor);

and see what happens
Comment 10 s.mehrbrodt 2013-11-02 15:39:35 UTC
I think the problem is that Glade cannot find the internal child (Line 36 in slidetransitionspanel.ui).

In glade_widget_read() the function glade_widget_get_internal_child() is called which looks only in the parents for the internal child. When I move the #treeview-selection above the #transitions_list e.g. in the .ui file, the crash doesn't happen anymore.
Comment 11 s.mehrbrodt 2013-11-02 15:47:46 UTC
Created attachment 258806 [details] [review]
Proposed Patch
Comment 12 Juan Pablo Ugarte 2013-11-26 00:00:12 UTC
BTW which versionof glib do you have? is >= 2.37?
Comment 13 s.mehrbrodt 2013-11-26 08:35:59 UTC
$ ldd --version
ldd (Ubuntu EGLIBC 2.17-93ubuntu4) 2.17
Comment 14 Juan Pablo Ugarte 2013-11-26 18:41:36 UTC
Ohh i meant glib not libc

$ dpkg -s libglib2.0-0
Comment 15 s.mehrbrodt 2013-11-26 22:12:05 UTC
$ dpkg -s libglib2.0-0
Package: libglib2.0-0
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 4289
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: glib2.0
Version: 2.38.1-0ubuntu1
...
Comment 16 Juan Pablo Ugarte 2013-11-26 23:57:35 UTC
Aha! yeah I think this bug is a duplicate of 705745.
There was a change in glib 2.37 that exposed a bug in glade
so you need glade-3-14 branch or 3.16

I will make a new release asap

*** This bug has been marked as a duplicate of bug 705745 ***