GNOME Bugzilla – Bug 319188
gnome-screenshot crashes due to escaping issues
Last modified: 2005-12-23 08:16:02 UTC
This bug has been described here: https://launchpad.net/distros/ubuntu/+sources/gnome-utils/+bug/3118 "if i try making a screenshot with alt+print from a gnome-torrent window gnome-screenshot crashes. ... > Thanks for your bug. Could you get a backtrace with libgnomevfs2-0-dbg and maybe a gnome-utils debug package (https://wiki.ubuntu.com/DebuggingProgramCrash) installed? ... It looks like there is a problem with the filename thats beeing created from the windows name, to long or to much bad characters (URI in URI problem?) sven-tek@desktu:~$ sleep 2 && gdb gnome-screenshot --window GNU gdb 6.3-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...(no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) run --window Starting program: /usr/bin/gnome-screenshot --window (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1222986048 (LWP 9423)] (gnome-screenshot:9423): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. (gnome-screenshot:9423): Gdk-WARNING **: locale not supported by C library resutlt: 13 ** (gnome-screenshot:9423): WARNING **: ERR:file:///home/sven-tek/mypics/Screens hot-0% of file:---tmp-ubuntu-5.10-live-i386.iso.torrent.png:Invalid URI resutlt: 13 ** (gnome-screenshot:9423): WARNING **: ERR:/home/sven-tek/Desktop/Screenshot-0% of file:---tmp-ubuntu-5.10-live-i386.iso.torrent.png:Invalid URI Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1222986048 (LWP 9423)] 0xb7d5feac in gnome_vfs_uri_to_string (uri=0x0, hide_options=GNOME_VFS_URI_HIDE_NONE) at gnome-vfs-uri.c:1160 1160 gnome-vfs-uri.c: No such file or directory. in gnome-vfs-uri.c (gdb) thread apply all bt
+ Trace 63601
Thread 1 (Thread -1222986048 (LWP 9423))
This happens for title with an "%" by example backtrace with a "python -c "import gtk; window=gtk.Window(); window.set_title('one%title'); window.show(); gtk.main()"" example: Backtrace was generated from '/usr/bin/gnome-screenshot' Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". `system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols. [Thread debugging using libthread_db enabled] [New Thread -1223722784 (LWP 25465)] 0xffffe410 in __kernel_vsyscall ()
+ Trace 63602
Thread 1 (Thread -1223722784 (LWP 25465))
Created attachment 53628 [details] [review] fixes the issue the current code use uri with path which creates the issue. This patch works fine for me.
ping? that fixes a crasher, could you comment on the patch?
I verified the crash and the fix. Patch applied to CVS HEAD. Thanks! 2005-12-23 Dennis Cranston <dennis_cranston@yahoo.com> * screenshot-dialog.c: (screenshot_dialog_get_uri): * screenshot-save.c: (screenshot_sanitize_filename): Escape the path strings. Fixes crash reported in bug #319188.