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 455304 - comments in ~/.gtk-bookmarks cause gtk applications to crash
comments in ~/.gtk-bookmarks cause gtk applications to crash
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other All
: High critical
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2007-07-09 21:38 UTC by James Hunt
Modified: 2008-10-07 10:41 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description James Hunt 2007-07-09 21:38:12 UTC
Steps to reproduce:
1. cat >>~/.gtk-bookmarks<EOF
file:///home/jhunt/work
file:///home/jhunt/work/svn/trunk
file:///home/jhunt/tmp
;smb://192.168.0.6/media
;ssh://192.168.0.2/data
EOF
2. Fire up an application using GTK (gedit, openoffice, etc).
3. File->Open
4. Application will crash.


Stack trace:
n/a.

Other information:
Admittedly, I'm not sure if specifying a comment by using a leading semi-colon is valid, but either way, the application should not crash - gtk should ignore lines it cannot parse, allowing the application to continue, and allow the user the change to select a file to open.
Comment 1 André Klapper 2007-07-10 14:27:09 UTC
Thanks for taking the time to report this bug.
Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Comment 2 Michel Boto 2007-07-28 22:52:41 UTC
No symbols on this machine, but I pulled the following from reproducing the problem running edit in GDB:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 19478)

  • #0 strchr
    from /lib/tls/i686/cmov/libc.so.6
  • #1 _gtk_file_chooser_label_for_uri
    from /usr/lib/libgtk-x11-2.0.so.0
  • #2 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 ??
    from /usr/lib/libglib-2.0.so.0
  • #7 ??
    from /usr/lib/gtk-2.0/2.10.0/filesystems/libgnome-vfs.so
  • #8 ??
  • #9 ??
  • #10 ??
  • #11 ??
  • #12 ??
  • #13 ??
  • #14 ??
    from /usr/lib/gtk-2.0/2.10.0/filesystems/libgnome-vfs.so
  • #15 ??


As soon as the semicolons are removed the crash disappears.
Comment 3 Paolo Borelli 2007-07-29 08:59:03 UTC
reassigning to gtk
Comment 4 Baptiste Mille-Mathias 2007-08-03 21:52:13 UTC
something "funny" is when the text after the semi-colon is not a path, the application doesn't crash.


################## The backtrace ##########################

Thread 1 (Thread -1228503376 (LWP 14449))

  • #0 strchr
    from /lib/tls/i686/cmov/libc.so.6
  • #1 _gtk_file_chooser_label_for_uri
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserdefault.c line 1684
  • #2 shortcuts_insert_path
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserdefault.c line 1802
  • #3 shortcuts_add_bookmarks
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserdefault.c line 2003
  • #4 gtk_file_chooser_default_set_property
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserdefault.c line 5358
  • #5 IA__g_object_set_property
    at /build/buildd/glib2.0-2.13.7/gobject/gobject.c line 697
  • #6 gtk_file_chooser_widget_set_property
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserwidget.c line 134
  • #7 IA__g_object_set_property
    at /build/buildd/glib2.0-2.13.7/gobject/gobject.c line 697
  • #8 gtk_file_chooser_dialog_set_property
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkfilechooserdialog.c line 319
  • #9 IA__g_object_newv
    at /build/buildd/glib2.0-2.13.7/gobject/gobject.c line 697
  • #10 IA__g_object_new_valist
    at /build/buildd/glib2.0-2.13.7/gobject/gobject.c line 1027
  • #11 IA__g_object_new
    at /build/buildd/glib2.0-2.13.7/gobject/gobject.c line 795
  • #12 gedit_file_chooser_dialog_new
  • #13 _gedit_cmd_file_open
  • #14 IA__g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.13.7/gobject/gmarshal.c line 77
  • #15 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.13.7/gobject/gclosure.c line 490
  • #16 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2440
  • #17 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2199
  • #18 IA__g_signal_emit
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2243
  • #19 _gtk_action_emit_activate
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkaction.c line 873
  • #20 closure_accel_activate
  • #21 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.13.7/gobject/gclosure.c line 490
  • #22 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2440
  • #23 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2209
  • #24 IA__g_signal_emit
    at /build/buildd/glib2.0-2.13.7/gobject/gsignal.c line 2243
  • #25 IA__gtk_accel_group_activate
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkaccelgroup.c line 739
  • #26 IA__gtk_accel_groups_activate
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkaccelgroup.c line 777
  • #27 IA__gtk_window_activate_key
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkwindow.c line 7979
  • #28 ??
  • #29 ??
  • #30 ??
  • #31 ??
  • #32 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 ??
  • #34 ??
  • #35 ??
  • #36 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd/gtk+2.0-2.11.6/gtk/gtkmarshalers.c line 84

Comment 5 Emmanuele Bassi (:ebassi) 2007-08-03 22:30:12 UTC
the .gtk-bookmarks file format is completely internal to gtk+ and should *never* be modified by the user (or any other application, for that matter) until gtk+ exposes some API to do so. unfortunately, some other applications started reading or writing it (the panel and nautilus) but no guarantees have ever been made.

in short: the user should *not* touch the file. there are plans of switching to a xbel-like format, accessible through the GBookmarkFile API, but some issues are still pending.
Comment 6 Baptiste Mille-Mathias 2007-08-04 06:32:40 UTC
Hi Emmanuele,

So this bug can be closed as INVALID ?
 
Comment 7 Emmanuele Bassi (:ebassi) 2007-08-04 08:28:39 UTC
yes. if you feed garbage to gtk+ then no assumptions can be made. you can always craft some malformed line that causes a crash, and this case is no different.
Comment 8 Federico Mena Quintero 2007-08-04 17:17:39 UTC
Even though we don't support comments, GTK+ should not crash --- it should simply ignore the offending lines.  Reopening.

[Shouldn't we just get a NULL back from gnome_vfs_uri_new and say "this is an invalid URI"?]
Comment 9 Matthias Clasen 2007-09-10 01:06:51 UTC
Seems to work fine with current trunk, with both the unix and gnome-vfs backends
Comment 10 Paolo Benvenuto 2008-10-07 09:18:53 UTC
I had this bug in ubuntu hardy because of an incorrectly formatted line in ~/.gtk-bookmarks.

The line was

/mnt/directory

Removing that line got the bug disappeared
Comment 11 Paolo Benvenuto 2008-10-07 09:40:14 UTC
That line was entered through the normal bookmark edit dialog, instead of selectin the directory in the directory tree on the left, I had entered the directory directly without the file:/// prefix in the position textbox.

The bookmark add dialog shouldn't close if there is an incorrectly formatted position.

If this isn't fixed in trunk, the bug shouldn't be left closed.
Comment 12 André Klapper 2008-10-07 09:41:20 UTC
Please don't tell us "Ubuntu Hardy" but the exact gtk+ version you have installed. Thanks.
Comment 13 Paolo Benvenuto 2008-10-07 09:49:39 UTC
~$ dpkg -l|grep libgtk2.0
ii  libgtk2.0-0                      2.12.9-3ubuntu5
ii  libgtk2.0-bin                    2.12.9-3ubuntu5
ii  libgtk2.0-cil                    2.12.0-2ubuntu3
ii  libgtk2.0-common                 2.12.9-3ubuntu5
Comment 14 Christian Dywan 2008-10-07 10:41:59 UTC
(In reply to comment #10)
> I had this bug in ubuntu hardy because of an incorrectly formatted line in
> ~/.gtk-bookmarks.
> 
> The line was
> 
> /mnt/directory
> 
> Removing that line got the bug disappeared

I think that's this one, fixed in 2.14:

Bug 541645 – gtkfilechooserdefault segfaults when bookmark does not
	contain ://