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 319549 - gnome.ui.icon_lookup() segfaults on weird filenames
gnome.ui.icon_lookup() segfaults on weird filenames
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: general
2.13.x
Other All
: High critical
: 2.14.x
Assigned To: libgnomeui maintainers
libgnomeui maintainers
: 330274 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-23 19:24 UTC by Mikkel Kamstrup Erlandsen
Modified: 2006-02-08 00:22 UTC
See Also:
GNOME target: 2.14.x
GNOME version: 2.13/2.14


Attachments
Small python script that segfaults on nome.ui.icon_lookup() (782 bytes, text/plain)
2005-10-23 19:29 UTC, Mikkel Kamstrup Erlandsen
  Details
patch (1.50 KB, patch)
2005-12-18 17:36 UTC, Felix Riemann
none Details | Review

Description Mikkel Kamstrup Erlandsen 2005-10-23 19:24:17 UTC
Steps to reproduce:
* Run the attached python script


Stack trace:
.
.
.
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
Lookup: file:///tmp
(no debugging symbols found)
(no debugging symbols found)
Got icon name: gnome-fs-directory
(no debugging symbols found)
Got pixbuf <gtk.gdk.Pixbuf object (GdkPixbuf) at 0xb6b62234>
Lookup: file:///home/mikkel/R%288!!mnE!!h%23+!!E%229!!

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 29135)

  • #0 gnome_icon_lookup
    from /usr/lib/libgnomeui-2.so.0
  • #1 gnome_icon_lookup_sync
    from /usr/lib/libgnomeui-2.so.0
  • #2 initui
    from /usr/lib/python2.4/site-packages/gtk-2.0/gnome/ui.so
  • #3 PyEval_EvalFrame
  • #4 PyEval_EvalFrame
  • #5 PyEval_EvalCodeEx
  • #6 PyEval_EvalCode
  • #7 PyRun_FileExFlags
  • #8 PyRun_SimpleFileExFlags
  • #9 Py_Main
  • #10 __libc_start_main
    from /lib/tls/i686/cmov/libc.so.6
  • #11 _start

Other information:
I attach a small python script that exposes the segfault
Comment 1 Mikkel Kamstrup Erlandsen 2005-10-23 19:29:07 UTC
Created attachment 53799 [details]
Small python script that segfaults on nome.ui.icon_lookup()

We discovered this bug while hacking on the deskbar-applet. Beagle started
digging up old evolution files with strange names. We tried to get icons for
them... 
Basically this is the problem:

UGLY_FILE = "file:///home/mikkel/R%288!!mnE!!h%23+!!E%229!!"

gnome.ui.icon_lookup(icon_theme, factory, UGLY_FILE, "",
gnome.ui.ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES)

=> segfault

Cheers
Mikkel
Comment 2 Felix Riemann 2005-12-18 17:36:03 UTC
Created attachment 56117 [details] [review]
patch

This is a patch preventing the segfault. The problem here was that the mime_type parameter is not set whith the UGLY_NAME crashing strcmp. The patch just checks if mime_type is set. If it's not the SVG-check won't work. The patch also skips the following if-statement because it's not becoming true when mime_type is not set.
With the patch applied I get the following output:

$ python gnomeui_icon_lookup_crash.py
Lookup: file:///tmp
** Message: foo
Got icon name: gnome-fs-directory
Got pixbuf <gtk.gdk.Pixbuf object (GdkPixbuf) at 0xb69885cc>
Lookup: file:///home/mikkel/R%288!!mnE!!h%23+!!E%229!!
** Message: foo
Got icon name: gnome-fs-regular
Got pixbuf <gtk.gdk.Pixbuf object (GdkPixbuf) at 0xb698861c>
Comment 3 Mikkel Kamstrup Erlandsen 2005-12-21 22:33:44 UTC
Yeay! -- Will get to testing asap. This will re-enable mime-type icons for deskbar if so.

Cheers

PS: Felix; do you have a famous ancestor? ;-P - sorry, I'm a mathematician... - had to ask.
Comment 4 Christian Neumair 2005-12-21 23:32:48 UTC
Updating version information, setting GNOME and library milestone.

Trying not to discuss about measure theory, Goedel and naive set theory, and why sometimes discrete maths feel more natural than Riemann sums.
Comment 5 Kjartan Maraas 2006-01-15 22:01:46 UTC
Commiting.
Comment 6 Raphael Slinckx 2006-02-08 00:22:57 UTC
*** Bug 330274 has been marked as a duplicate of this bug. ***