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 651209 - segfault in gtk_icon_info_load_symbolic when icon is not found
segfault in gtk_icon_info_load_symbolic when icon is not found
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Crashers
3.0.x
Other Linux
: Normal critical
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-27 06:17 UTC by Alexandre Rostovtsev
Modified: 2011-09-07 19:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to prevent the segfault (3.15 KB, patch)
2011-05-27 06:19 UTC, Alexandre Rostovtsev
rejected Details | Review

Description Alexandre Rostovtsev 2011-05-27 06:17:11 UTC
Users of Gentoo and Fedora have reported segfaults in nautilus-3.0.x in gtk_icon_info_load_symbolic (see http://bugs.gentoo.org/show_bug.cgi?id=365779, https://bugzilla.redhat.com/show_bug.cgi?id=690357, https://bugzilla.redhat.com/show_bug.cgi?id=693636). One of them was helpful enough to post a backtrace with
debugging information: https://bugzilla.redhat.com/attachment.cgi?id=489928

The backtrace shows that the crash occurs because we are passing a NULL icon_info to gtk_icon_info_load_symbolic in lookup_and_color_symbolic_find in nautilus-search-bar.c; indeed, icon_info will be NULL if gtk_icon_theme_lookup_icon fails to find an icon.

An identical problem exists in get_eject_icon in nautilus-places-sidebar.c, where gtk_icon_info_load_symbolic_for_context and gtk_icon_theme_lookup_by_gicon are used.

The solution is to check for the NULL icon_info, and return a NULL GdkPixbuf. Note that returning a NULL from lookup_and_color_symbolic_find and get_eject_icon is safe: in both cases, the return value is only used in functions that can safely deal with a NULL (although some of them will print error messages in complaint).
Comment 1 Alexandre Rostovtsev 2011-05-27 06:19:08 UTC
Created attachment 188726 [details] [review]
Patch to prevent the segfault
Comment 2 Cosimo Cecchi 2011-09-07 19:35:47 UTC
I committed a cleanup of the entry code to git master, which should also fix this kind of crashes when icons are missing from the theme.