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 348063 - _gtk_icon_cache_get_icon crashes when no cache available
_gtk_icon_cache_get_icon crashes when no cache available
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-07-20 00:10 UTC by Diego Elio Pettenò
Modified: 2006-07-20 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk+-2.10.0-nullpointer.patch (513 bytes, patch)
2006-07-20 00:11 UTC, Diego Elio Pettenò
none Details | Review

Description Diego Elio Pettenò 2006-07-20 00:10:22 UTC
Steps to reproduce:
I've been hitting this since I installed wireshark on an otherwise mostly KDE system


Stack trace:
0  find_image_offset (cache=0x0, icon_name=0x2ae2173963c6 "gtk-missing-image", directory=0x2ae2173963c3 "24") at gtkiconcache.c:219
  • #1 _gtk_icon_cache_get_icon
    at gtkiconcache.c line 420
  • #2 render_fallback_image
    at gtkiconfactory.c line 1571
  • #3 IA__gtk_icon_set_render_icon
    at gtkiconfactory.c line 1643
  • #4 IA__gtk_widget_render_icon
    at gtkwidget.c line 5562
  • #5 gtk_image_calc_size
    at gtkimage.c line 1962
  • #6 gtk_image_size_request
    at gtkimage.c line 2003
  • #7 IA__g_closure_invoke
    at gclosure.c line 490
  • #8 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #9 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #10 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #11 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 779
  • #12 gtk_vbox_size_request
    at gtkvbox.c line 95
  • #13 IA__g_closure_invoke
    at gclosure.c line 490
  • #14 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #15 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #16 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #17 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 779
  • #18 gtk_button_size_request
    at gtkbutton.c line 1129
  • #19 IA__g_closure_invoke
    at gclosure.c line 490
  • #20 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #21 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #22 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #23 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 779
  • #24 toolbar_content_size_request
    at gtktoolbar.c line 4145
  • #25 gtk_toolbar_size_request
    at gtktoolbar.c line 929
  • #26 IA__g_closure_invoke
    at gclosure.c line 490
  • #27 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #28 IA__g_signal_emit_valist
    at gsignal.c line 2197


Other information:
The problem relies actually in find_image_offset, that dereferences almost immediately the cache pointer parameter it is given, without doing any check for its validity. But the problem seems to rely after all on _gtk_icon_cache_get_icon, one call above, that should check for the cache parameter given to it.

I'm going to attach a simple patch that seems to solve the problem to me, although it might require to add a GTK_NOTE message or something.. I'm not used to gtk's code so I can't tell.

HTH,
Diego
Comment 1 Diego Elio Pettenò 2006-07-20 00:11:12 UTC
Created attachment 69208 [details] [review]
gtk+-2.10.0-nullpointer.patch
Comment 2 Matthias Clasen 2006-07-20 18:07:27 UTC
2006-07-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkicontheme.h: 
	* gtk/gtkicontheme.c (_gtk_icon_theme_ensure_builtin_cache): 
	Export this privately.

	* gtk/gtkiconfactory.c (render_fallback_image): And call it
	here to initialize the builtin cache before using it.  (#348063,
	Diego Pettenò)