GNOME Bugzilla – Bug 377699
realizing gtk.Progress() causes SEGV
Last modified: 2008-11-17 09:52:02 UTC
>>> import gtk >>> win = gtk.Window() >>> win.add(gtk.Progress()) >>> win.show_all() Segmentation fault gtk.Progress, the base class for gtk.ProgressBar, can be added to a container without error, but when shown causes segmentation fault in gtk extentsion to python, here's the backtrace: (gdb) bt
+ Trace 88195
A bug in Gtk+, moving.
I don't know if this can be fixed using G_DEFINE_ABSTRACT_TYPE() instead of G_DEFINE_TYPE() without breaking things, if that's not possible we should override tp.new in the Python bindings and return the same error string as if gtk+ itself defines GtkProgress as an abstract type.
no, declaring it as an abstract type would not break anything: existing code should not be calling g_object_new (GTK_TYPE_PROGRESS, ...) anyway, and if it did it would be a programming error (the GtkProgress class is defined as abstract in the documentation. it's just possible that, when transitioning to the G_DEFINE_TYPE macro, the abstract flag got simply lost.
Created attachment 118286 [details] [review] Define GtkProgress as an abstract type Using the right macro seems most appropriate here. It won't change anything except that bogus code errors out earlier than before.
Tha abstract flag was not there before porting to G_DEFINE_TYPE(), but declaring the class as abstract is IMHO the right thing to do anyway, given it is deprecated and only kept around for compatibility.
borked attachment status
(In reply to comment #4) > Created an attachment (id=118286) [edit] > Define GtkProgress as an abstract type > > Using the right macro seems most appropriate here. It won't change anything > except that bogus code errors out earlier than before. Please go ahead and apply the fix.
2008-11-17 Christian Dywan <christian@imendio.com> Bug 377699 – realizing gtk.Progress() causes SEGV * gtk/gtkprogress.c: Define GtkProgress as an abstract type