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 702886 - SEGV when creating a new GtkDialog (GLib 2.37.x)
SEGV when creating a new GtkDialog (GLib 2.37.x)
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal blocker
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
: 731080 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-06-23 08:39 UTC by Fredy Paquet
Modified: 2014-06-02 20:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fredy Paquet 2013-06-23 08:39:11 UTC
This issue can be reproduced on Linux x86_64 and Windows MinGW 32-bit.
The crash occurs everytime, it renders Glade unusable.

Description
- SEGV when adding a new top-level GtkDialog to an empty project
- SEGV when adding a GtkComboBox
- SEGV when loading a GtkBuilder .ui definition containing any composed widgets

Analysis

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dabe41 in glade_widget_set_object (gwidget=0x8a3620, 
    new_object=0x10d3820, destroy=1) at glade-widget.c:3359
3359		g_return_if_fail (new_object == NULL || 
			  g_type_is_a (G_OBJECT_TYPE (new_object),
				       gwidget->adaptor->type));


Glade-3 crashes during creation of the GtkDialog's internal GtkVBox 
because gwidget->adaptor is NULL

The creation of the 'adaptor' can be tracked down to frame #3 (see stack
trace below). It gets lost somewhere in Frame #2,#1,#0

Looks like a problem with the custom widget constructor methods of GLib.

The following GLib versions have been checked:
- GLib 2.34.3 - no crash
- GLib 2.35.7 - no crash
- GLib 2.36.x - not tested
- GLib 2.37.1 - SEGV

When creating different composed widgets, the stack trace looks very similar  and always ends up at the same location at glade-widget.c:3359 

Adding an additional check for (gwidget->adaptor != NULL) doesn't help, it will crash later at different locations.

Stack trace

  • #0 glade_widget_set_object
    at glade-widget.c line 3359
  • #1 object_set_property
    at gobject.c line 1358
  • #2 g_object_constructor
    at gobject.c line 2034
  • #3 glade_widget_constructor
    at glade-widget.c line 712
  • #4 g_object_new_with_custom_constructor
    at gobject.c line 1657
  • #5 g_object_new_internal
    at gobject.c line 1736
  • #6 g_object_new_valist
    at gobject.c line 1994
  • #7 glade_widget_adaptor_create_widget_real
    at glade-widget-adaptor.c line 2413
  • #8 glade_widget_adaptor_create_internal
    at glade-widget-adaptor.c line 2349
  • #9 glade_gtk_dialog_post_create
    at glade-gtk.c line 5484
  • #10 glade_widget_constructor
    at glade-widget.c line 792
  • #11 g_object_new_with_custom_constructor
    at gobject.c line 1657
  • #12 g_object_new_internal
    at gobject.c line 1736
  • #13 g_object_new_valist
    at gobject.c line 1994
  • #14 glade_widget_adaptor_create_widget_real
    at glade-widget-adaptor.c line 2413
  • #15 glade_command_create
    at glade-command.c line 1730
  • #16 glade_palette_create_root_widget
    at glade-palette.c line 423
  • #17 glade_palette_toggled
    at glade-palette.c line 326

Additional Glade-3 debug output:

$ gdb glade-3
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/casy/gtk/.Linux.3.x86_64/bin/glade-3...done.
(gdb) r

Starting program: /opt/casy/gtk/.Linux.3.x86_64/bin/glade-3 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffd000
[Thread debugging using libthread_db enabled]

(glade-3:5648): GladeUI-WARNING **: Failed to open catalog directory '': Error opening directory '': No such file or directory

(glade-3:5648): GladeUI-WARNING **: Failed to open catalog directory '': Error opening directory '': No such file or directory
GladeUI-Message: No displayable values for property GtkToolPalette::icon-size
GladeUI-Message: No displayable values for property GtkToolItemGroup::ellipsize
GladeUI-Message: No displayable values for property GtkToolItemGroup::header-relief

(glade-3:5648): GladeUI-WARNING **: Already registered displayable value None for none (type GtkSelectionMode)

(glade-3:5648): GladeUI-WARNING **: Already registered displayable value Single for single (type GtkSelectionMode)

(glade-3:5648): GladeUI-WARNING **: Already registered displayable value Browse for browse (type GtkSelectionMode)
GladeUI-Message: 2 missing displayable value for GtkSheet::selection-mode
GladeUI-Message: No displayable values for property GtkSheet::entry-type
GladeUI-Message: No displayable values for property GtkSheet::vjust
GladeUI-Message: No displayable values for property GtkSheetColumn::entry-type
GladeUI-Message: No displayable values for property GtkSheetColumn::vjust
GladeUI-Message: Glade needs artwork; a default icon will be used for the following classes:
	GtkPlotData	needs an icon named 'widget-gtkextra-gtkplotdata'
	GtkPlotCanvasEllipse	needs an icon named 'widget-gtkextra-gtkplotcanvasellipse'
	GtkPlotCanvasRectangle	needs an icon named 'widget-gtkextra-gtkplotcanvasrectangle'
	GtkPlotPS	needs an icon named 'widget-gtkextra-gtkplotps'
	GtkPlotSurface	needs an icon named 'widget-gtkextra-gtkplotsurface'
	GtkPlotCanvasLine	needs an icon named 'widget-gtkextra-gtkplotcanvasline'
	GtkPlotArrayList	needs an icon named 'widget-gtkextra-gtkplotarraylist'
	GtkPlotSegment	needs an icon named 'widget-gtkextra-gtkplotsegment'
	GtkDirTree	needs an icon named 'widget-gtkextra-gtkdirtree'
	GtkPlotPC	needs an icon named 'widget-gtkextra-gtkplotpc'
	GtkPlotArray	needs an icon named 'widget-gtkextra-gtkplotarray'
	GtkPlotDT	needs an icon named 'widget-gtkextra-gtkplotdt'
	GtkPlotCanvasPlot	needs an icon named 'widget-gtkextra-gtkplotcanvasplot'
	GtkPlotCanvasPixmap	needs an icon named 'widget-gtkextra-gtkplotcanvaspixmap'
	GtkPlotBar	needs an icon named 'widget-gtkextra-gtkplotbar'
	GtkPlotCanvasText	needs an icon named 'widget-gtkextra-gtkplotcanvastext'
	GtkPlotGdk	needs an icon named 'widget-gtkextra-gtkplotgdk'
	GtkPlotCSurface	needs an icon named 'widget-gtkextra-gtkplotcsurface'
	GtkPlotCanvasChild	needs an icon named 'widget-gtkextra-gtkplotcanvaschild'
	GtkDataEntry	needs an icon named 'widget-gtkextra-gtkdataentry'
GladeUI-Message: No DevHelp installed on your system, devhelp feature will be disabled.
[New Thread 0x7fffeb039700 (LWP 5682)]
[New Thread 0x7fffea838700 (LWP 5683)]
[New Thread 0x7fffea037700 (LWP 5685)]
[New Thread 0x7fffe9836700 (LWP 5686)]
[New Thread 0x7fffe9035700 (LWP 5688)]
[Thread 0x7fffe9035700 (LWP 5688) exited]
[Thread 0x7fffea838700 (LWP 5683) exited]
[Thread 0x7fffeb039700 (LWP 5682) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dabe41 in glade_widget_set_object (gwidget=0x8a3620, 
    new_object=0xfe2050, destroy=1) at glade-widget.c:3359
3359		g_return_if_fail (new_object == NULL ||
Comment 1 Juan Pablo Ugarte 2013-09-05 18:30:32 UTC
Fixed in glade-3-8 branch.
The problem was that glib changed the order in which contruct properties are set, so when glade was creating the internal children wrapper object the object was being set before the adaptor triggering the bug.

https://git.gnome.org/browse/glade/commit/?h=glade-3-8&id=9aa539e209281201256a71e2ebc434f7fd97262b

BTW I will make a new release soon!
Comment 2 Fredy Paquet 2013-09-05 19:50:34 UTC
Thanks, we will check it out.
fp
Comment 3 Fredy Paquet 2013-10-13 06:43:15 UTC
Checked with GLib 2.37.93 / Glade 3.8.4 - working.
Comment 4 Juan Pablo Ugarte 2014-06-02 20:06:56 UTC
*** Bug 731080 has been marked as a duplicate of this bug. ***