GNOME Bugzilla – Bug 657399
gtk_style_context_get_background_color now segfaults reliably
Last modified: 2011-08-26 10:38:33 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
+ Trace 228221
Thread 1 (Thread 0x7ffff7c27720 (LWP 1824))
============ 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)>
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