GNOME Bugzilla – Bug 319549
gnome.ui.icon_lookup() segfaults on weird filenames
Last modified: 2006-02-08 00:22:57 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.
+ Trace 63674
Thread NaN (LWP 29135)
Other information: I attach a small python script that exposes the segfault
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
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>
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.
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.
Commiting.
*** Bug 330274 has been marked as a duplicate of this bug. ***