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 657399 - gtk_style_context_get_background_color now segfaults reliably
gtk_style_context_get_background_color now segfaults reliably
Status: RESOLVED NOTABUG
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 626252
 
 
Reported: 2011-08-26 04:34 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2011-08-26 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Joanmarie Diggs (IRC: joanie) 2011-08-26 04:34:47 UTC
With pygobject from master:

>>> from gi.repository import Gtk
>>> style = Gtk.StyleContext()
>>> style.get_background_color(Gtk.StateFlags.NORMAL)

(.:2077): Gtk-CRITICAL **: gtk_style_context_get: assertion `priv->widget_path != NULL' failed
Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
ffi_call_unix64 () at ../src/x86/unix64.S:80
80		movq	0(%rbp), %rcx		/* Reload flags.  */
(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7c27720 (LWP 1824))

  • #0 ffi_call_unix64
    at ../src/x86/unix64.S line 80

============

Same box, static bindings:

>>> import gtk
>>> style = gtk.Style()
>>> style.bg[gtk.STATE_NORMAL]
gtk.gdk.Color('#dcdad5')

============

Different box, earlier version of pygobject:

>>> from gi.repository import Gtk
>>> style = Gtk.StyleContext()
>>> style.get_background_color(Gtk.StateFlags.NORMAL)

(.:2457): Gtk-CRITICAL **: gtk_style_context_get_background_color: assertion `priv->widget_path != NULL' failed
<Gdk.Color(red=1.000000, green=0.750000, blue=0.750000, alpha=1.000000)>
Comment 1 Joanmarie Diggs (IRC: joanie) 2011-08-26 10:38:33 UTC
Closing as not a bug based on this conversation:

< jdahlin> joanie: you can't just ask for a random background color, you need to get the style context from an existing widget
< joanie> (you could before :-P)
< joanie> and even if it was bogus or unmeaningful without an existing widget, should it segfault?
< jdahlin> the problem is gtk3, not introspection
< jdahlin> then you need to instantiate a bogus widget
< joanie> okay, so I should transfer it to gtk3, right?
< joanie> and tell jhernandez to add a bogus widget to accerciser?
< jdahlin> joanie: I don't think it's a bug
< joanie> really?
< joanie> okie dokie
< jdahlin> not gtk3 at least, you need to change accerciser