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 319188 - gnome-screenshot crashes due to escaping issues
gnome-screenshot crashes due to escaping issues
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: screenshot
2.12.x
Other Linux
: High critical
: ---
Assigned To: Jonathan Blandford
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-18 21:53 UTC by Sebastien Bacher
Modified: 2005-12-23 08:16 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
fixes the issue (936 bytes, patch)
2005-10-18 22:02 UTC, Sebastien Bacher
none Details | Review

Description Sebastien Bacher 2005-10-18 21:53:48 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

Thread 1 (Thread -1222986048 (LWP 9423))

  • #0 gnome_vfs_uri_to_string
    at gnome-vfs-uri.c line 1160
  • #2 _start
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 g_type_check_instance_is_a
    from /usr/lib/libgobject-2.0.so.0
  • #7 main

Comment 1 Sebastien Bacher 2005-10-18 21:58:32 UTC
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 ()

Thread 1 (Thread -1223722784 (LWP 25465))

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 749
  • #3 <signal handler called>
  • #4 gnome_vfs_uri_to_string
    at gnome-vfs-uri.c line 1160

Comment 2 Sebastien Bacher 2005-10-18 22:02:49 UTC
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.
Comment 3 Sebastien Bacher 2005-11-10 10:49:54 UTC
ping? that fixes a crasher, could you comment on the patch?
Comment 4 Dennis Cranston 2005-12-23 08:16:02 UTC
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.