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 705860 - Recent deprecation change breaks existing users of gtk_recent_info_get_icon
Recent deprecation change breaks existing users of gtk_recent_info_get_icon
Status: RESOLVED INVALID
Product: gtk+
Classification: Platform
Component: Widget: Other
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-12 16:14 UTC by Joshua Lock
Modified: 2013-09-20 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case demonstrating use of gtk_recent_info_get_icon with GTK_ICON_SIZE_BUTTON (912 bytes, text/plain)
2013-08-16 08:50 UTC, Joshua Lock
Details

Description Joshua Lock 2013-08-12 16:14:25 UTC
The removal of the gtkiconfactory.h include from gtkrecentmanager.c in commit 2f1fa7cdc3735b13561f27345f43ed3ac6883d8e[1]  breaks use of gtk_recent_info_get_icon when passing a GtkIconSize enum as the size parameter.

1. https://git.gnome.org/browse/gtk+/commit/?id=2f1fa7cdc3735b13561f27345f43ed3ac6883d8e
Comment 1 Matthias Clasen 2013-08-13 15:21:17 UTC
I don't see how it could, really. The code compiles without warnings. Can you produce a test case ?
Comment 2 Joshua Lock 2013-08-16 08:50:10 UTC
Created attachment 251792 [details]
Test case demonstrating use of gtk_recent_info_get_icon with GTK_ICON_SIZE_BUTTON

Apologies if I've incorrectly root caused this.

I noticed something was wrong when I switched to building Brasero against master (instead of 3.8.2) and made the following change to prevent the observed segfault:
https://git.gnome.org/browse/brasero/commit/?id=2eb68c9855e202899a3ab71d14d884c80c57b38a

Attached is a reduced test case which mimics what is done in the Brasero code, the commented out lines reflect the change I made in the Brasero commit above to workaround the segfault, namely using gtk_recent_info_get_gicon () rather than gtk_recent_info_get_icon ().

Here's the output of running my test program against gtk+ master:

$ ./test 
Gtk-Message: Failed to load module "pk-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_bits_per_sample: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_has_alpha: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_colorspace: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_pixels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_data: assertion 'data != NULL' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_bits_per_sample: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_has_alpha: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_colorspace: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_pixels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_data: assertion 'data != NULL' failed
**
Gtk:ERROR:gtkrecentmanager.c:1960:get_icon_fallback: assertion failed: (retval != NULL)
Aborted (core dumped)
Comment 3 Matthias Clasen 2013-09-17 03:56:48 UTC
>  pix = gtk_recent_info_get_icon (info, GTK_ICON_SIZE_BUTTON);

I don't see how this could have ever worked - the size parameter to gtk_recent_info_get_icon is a pixel size, not a symbolic icon size.
You are trying to load a 4x4 icon here.
Comment 4 Joshua Lock 2013-09-20 09:05:22 UTC
Thanks for taking the time to look at this Matthias, I only recently inherited this code and noticed a crash when building against newer gtk+.