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 742656 - Crash when setting background
Crash when setting background
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Debarshi Ray
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-09 16:54 UTC by Marek Chalupa
Modified: 2015-01-21 08:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check if icon_info is NULL (1.49 KB, patch)
2015-01-09 16:54 UTC, Marek Chalupa
needs-work Details | Review
background: Fix crash when choosing background due to missing icon (1.52 KB, patch)
2015-01-19 13:15 UTC, Debarshi Ray
committed Details | Review

Description Marek Chalupa 2015-01-09 16:54:53 UTC
Created attachment 294170 [details] [review]
check if icon_info is NULL

Hi,

when I run gnome-control-center, click on Background and then click on either Background or Lock Screen to change the picture, I get:

(gnome-control-center:3758): Gtk-CRITICAL **: gtk_icon_info_load_icon: assertion 'icon_info != NULL' failed
zsh: segmentation fault (core dumped)  /usr/bin/gnome-control-center

Looking into code (get_emblemed_pixbuf in panels/background/cc-background-item.c) there is:

icon_info = gtk_icon_theme_lookup_by_gicon_for_scale(...)
gtk_icon_info_load_icon(icon_info, ...)

where the gtk_icon_theme_lookup_by_gicon_for_scale returns NULL so gtk_icon_info_load_icon causes crash.

Attached patch works for me, but I don't know if it is the right way how to fix it.

Regards,
Marek
Comment 1 Bastien Nocera 2015-01-09 17:13:40 UTC
Review of attachment 294170 [details] [review]:

Looks like your icon theme is missing the slideshow-emblem icon. Are you not using the default icon theme?

The code in itself looks good, thanks for the patch.

::: panels/background/cc-background-item.c
@@ +114,3 @@
                                                                               GTK_ICON_LOOKUP_USE_BUILTIN);
+                        if (!icon_info) {
+                                g_warning ("Failed to load information about icon");

Add the icon name in the warning. It would be easier to mention:
"Your icon theme is missing the slideshow-emblem icon, please file a bug against it"
Comment 2 Debarshi Ray 2015-01-19 13:15:25 UTC
Created attachment 294874 [details] [review]
background: Fix crash when choosing background due to missing icon

Address Bastien's comments and add the bugzilla URL to the commit message.
Comment 3 Bastien Nocera 2015-01-19 14:10:44 UTC
Review of attachment 294874 [details] [review]:

Looks good.
Comment 4 Debarshi Ray 2015-01-19 14:26:06 UTC
Comment on attachment 294874 [details] [review]
background: Fix crash when choosing background due to missing icon

Thanks for the review, Bastien. Pushed to master and gnome-3-14.
Comment 5 Marek Chalupa 2015-01-21 08:36:45 UTC
Hi,

thanks Debarshi for the patch, I was slowly getting to it, but you were faster :)