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 308639 - Dragging an item into the trash causes nautilus to freeze or crash
Dragging an item into the trash causes nautilus to freeze or crash
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.12.x
Other All
: High critical
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 310465 312536 315669 334712 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-06-22 11:57 UTC by Kevin Brown
Modified: 2006-03-18 06:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
testing program (1.01 KB, text/plain)
2005-09-12 11:08 UTC, Christian Neumair
  Details
Proposed patch (664 bytes, patch)
2005-09-12 12:27 UTC, Christian Neumair
committed Details | Review
testing program 2 (1.07 KB, text/plain)
2005-09-12 13:06 UTC, Christian Neumair
  Details
Proposed patch (682 bytes, patch)
2005-09-12 15:02 UTC, Christian Neumair
rejected Details | Review
Proposed patch (1.25 KB, patch)
2005-09-12 15:18 UTC, Christian Neumair
none Details | Review
Proposed patch (1.25 KB, patch)
2005-09-12 20:17 UTC, Christian Neumair
committed Details | Review

Description Kevin Brown 2005-06-22 11:57:09 UTC
Distribution: Debian testing/unstable
Package: nautilus
Severity: normal
Version: GNOME2.10.1 2.10.1
Gnome-Distributor: Debian
Synopsis: Dragging an item into the trash causes nautilus to freeze or crash
Bugzilla-Product: nautilus
Bugzilla-Component: general
Bugzilla-Version: 2.10.1
BugBuddy-GnomeVersion: 2.0 (2.10.0)
Description:
Description of the crash:

Dragging an item into the trash will usually cause nautilus to freeze or
crash (which one it does seems to be random).  The freeze or crash
occurs at the point that the object being dragged to the trashcan passes
over the trashcan.  This never happens when one selects the "move to
trash" context-menu option on the object being trashed.


Steps to reproduce the crash:

1. Drag item to trash
2. Empty trash
3. Drag another item to the trash


Expected Results:

Item should be placed into trashcan


How often does this happen?

Every time after the trash has been emptied, except for the first time
an item is dragged to the trashcan after nautilus has started up.  If
the trash is empty and nautilus has just been started, the operation
will work fine, as will all subsequent attempts to drag an item (I've
been testing with folders) to the trashcan.  But once the trash is
emptied, the next attempt to drag an item to the trashcan will cause
nautilus to freeze/crash as described.


Additional Information:



Debugging Information:

Backtrace was generated from '/usr/bin/nautilus'

(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(no debugging symbols found)
`system-supplied DSO at 0xffffe000' has disappeared; keeping its
symbols.
(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)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1224416096 (LWP 11935)]
[New Thread -1235833936 (LWP 11939)]
[New Thread -1235571792 (LWP 11938)]
[New Thread -1235309648 (LWP 11937)]
[New Thread -1225774160 (LWP 11936)]
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
0xb7bdc561 in __waitpid_nocancel () from /lib/tls/libpthread.so.0

Thread 1 (Thread -1224416096 (LWP 11935))

  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
  • #1 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #2 <signal handler called>
  • #3 gnome_vfs_format_file_size_for_display
    from /usr/lib/libgnomevfs-2.so.0
  • #4 gnome_vfs_escape_path_string
    from /usr/lib/libgnomevfs-2.so.0
  • #5 gnome_vfs_uri_append_path
    from /usr/lib/libgnomevfs-2.so.0
  • #6 _gnome_vfs_uri_resolve_all_symlinks_uri
    from /usr/lib/libgnomevfs-2.so.0
  • #7 gnome_vfs_find_directory_cancellable
    from /usr/lib/libgnomevfs-2.so.0
  • #8 gnome_vfs_find_directory
    from /usr/lib/libgnomevfs-2.so.0
  • #9 nautilus_drag_default_drop_action_for_icons
    from /usr/lib/libnautilus-private.so.2
  • #10 nautilus_self_check_icon_container
    from /usr/lib/libnautilus-private.so.2
  • #11 nautilus_icon_dnd_begin_drag
    from /usr/lib/libnautilus-private.so.2
  • #12 _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #17 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #20 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 gtk_drag_dest_find_target
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 _gtk_drag_dest_handle_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #26 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #27 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #28 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #29 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #30 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #31 main
  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0




------- Bug moved to this database by unknown@bugzilla.gnome.org 2005-06-22 11:57 UTC -------


Unknown version 2.10.1 in product nautilus.  Setting version to "2.10.x".
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here, unknown@bugzilla.gnome.org.
   Previous reporter was kevin@sysexperts.com.

Comment 1 Sebastien Bacher 2005-06-24 11:52:52 UTC
Thanks for the bug report. Unfortunately, that stack trace is not very useful in
determining the cause of the crash. Can you get one
(http://live.gnome.org/GettingTraces) with the libgnomevfs2-0-dbg nautilus-dbg
packages installed?
Comment 2 Kevin Brown 2005-06-24 22:34:12 UTC
Hmm...very strange.  I presume that nautilus-dbg supplies alternative
executables that should be used in lieu of the ones supplied by the nautilus
package, yes?

If so, then nautilus-dbg seems to be a dead-in-the-water package.  When I
attempt to run the 'nautilus' executable supplied by that package, I get an
immediate core dump.  gdb of that shows:

Core was generated by `/usr/lib/debug/usr/bin/nautilus'.
Program terminated with signal 11, Segmentation fault.
  • #0 _start
    at ../sysdeps/i386/elf/start.S line 47
  • #0 _start
    at ../sysdeps/i386/elf/start.S line 47

kevin@filer:~$ file /usr/lib/debug/usr/bin/nautilus
/usr/lib/debug/usr/bin/nautilus: ELF 32-bit LSB executable, Intel 80386, version
1 (SYSV), statically linked, not stripped


Did someone break that package in debian unstable?  The version I'm using is:

kevin@filer:~$ dpkg -l nautilus-dbg
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  nautilus-dbg   2.10.1-2       file manager and graphical shell for GNOME


Comment 3 Sebastien Bacher 2005-06-25 10:44:36 UTC
no, nautilus-dbg provides debugging symboles which are picked by gdb when it
gets the backtrace
Comment 4 Kevin Brown 2005-06-26 06:23:55 UTC
Here's a stacktrace with nautilus-dbg, libgnomevfs2-0-dbg, and libglib2.0-0-dbg
installed:

Backtrace was generated from '/usr/bin/nautilus'

Using host libthread_db library "/lib/tls/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1224395616 (LWP 3744)]
[New Thread -1235752016 (LWP 3750)]
[New Thread -1235489872 (LWP 3749)]
[New Thread -1235227728 (LWP 3748)]
[New Thread -1225733200 (LWP 3747)]
0xb7be1561 in __waitpid_nocancel () from /lib/tls/libpthread.so.0

Thread 1 (Thread -1224395616 (LWP 3744))

  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
  • #1 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #2 <signal handler called>
  • #3 gnome_vfs_escape_string_internal
    at gnome-vfs-utils.c line 234
  • #4 gnome_vfs_escape_path_string
    at gnome-vfs-utils.c line 277
  • #5 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1061
  • #6 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 2001
  • #7 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 295
  • #8 gnome_vfs_find_directory
    at gnome-vfs-find-directory.c line 63
  • #9 nautilus_drag_default_drop_action_for_icons
    at nautilus-dnd.c line 335
  • #10 nautilus_icon_container_get_drop_action
    at nautilus-icon-dnd.c line 1102
  • #11 drag_motion_callback
    at nautilus-icon-dnd.c line 1407
  • #12 _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT
    at gtkmarshalers.c line 330
  • #13 IA__g_closure_invoke
    at gclosure.c line 437
  • #14 signal_emit_unlocked_R
    at gsignal.c line 2488
  • #15 IA__g_signal_emit_valist
    at gsignal.c line 2257
  • #16 IA__g_signal_emit_by_name
    at gsignal.c line 2315
  • #17 gtk_drag_dest_motion
    at gtkdnd.c line 1801
  • #18 gtk_drag_find_widget
    at gtkdnd.c line 1505
  • #19 gtk_drag_find_widget
    at gtkdnd.c line 1490
  • #20 gtk_drag_find_widget
    at gtkdnd.c line 1490
  • #21 gtk_drag_find_widget
    at gtkdnd.c line 1490
  • #22 gtk_drag_find_widget
    at gtkdnd.c line 1490
  • #23 _gtk_drag_dest_handle_event
    at gtkdnd.c line 1190
  • #24 IA__gtk_main_do_event
    at gtkmain.c line 1428
  • #25 gdk_event_dispatch
    at gdkevents-x11.c line 2259
  • #26 g_main_dispatch
    at gmain.c line 1933
  • #27 IA__g_main_context_dispatch
    at gmain.c line 2483
  • #28 g_main_context_iterate
    at gmain.c line 2564
  • #29 IA__g_main_loop_run
    at gmain.c line 2768
  • #30 IA__gtk_main
    at gtkmain.c line 974
  • #31 main
    at nautilus-main.c line 432
  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
 
Comment 5 Sebastien Bacher 2005-06-26 12:06:01 UTC
thanks for the backtrace!
Comment 6 Kevin Brown 2005-07-02 01:51:56 UTC
Did it help?

If not, is there something else I can do to give better or more useful info?
Comment 7 Kevin Brown 2005-07-02 01:56:24 UTC
Additional details, in case they may prove relevant:

I have a system at work with the same distribution, running the same packages. 
It does *not* seem to experience the problem in question.

There might be metadata that differs between the working system and the
non-working system, but I have no idea what to check or how to check it.  Hints
on how to go about examining that would be helpful.

But since this is related to trashcan handling, there's one additional
difference between the two systems that may be relevant: the system that works
is using ext3 as the filesystem, while the system that fails is using IBM's JFS
as the filesystem.

That shouldn't make any difference, of course, since both filesystems adhere to
the same API (and are, in any case, hidden behind a VFS layer), but it may prove
noteworthy.
Comment 8 Teppo Turtiainen 2005-07-15 13:25:26 UTC
*** Bug 310465 has been marked as a duplicate of this bug. ***
Comment 9 Martin Wehner 2005-08-19 22:44:32 UTC
Adjusting priority/severity and confirming.
Comment 10 Timo Aaltonen 2005-09-08 13:31:38 UTC
I'm apparently hit by this, but already on login.. In our environment my $HOME
is /u/lai/lk/tjaalton, /u is a real directory and /u/lai a symlink to a
NFS-mount. On my laptop I have /u as a symlink to /home/u (because no
NFS-mounts..), and under it the rest. So, nautilus/trashapplet crash on me
_only_ if the first part of $HOME is a symlink (in this case, /u), but not if it
is a real directory...

Maybe this didn't confuse you too much ;)
Comment 11 Christian Kirbach 2005-09-12 09:22:12 UTC
*** Bug 315669 has been marked as a duplicate of this bug. ***
Comment 12 Christian Kirbach 2005-09-12 09:24:22 UTC
So, could the problem be target_uri_string=0x0 in frame #9 ?
Comment 13 Christian Kirbach 2005-09-12 10:48:25 UTC
cc'ing  Vasily Chekalkin
Comment 14 Christian Kirbach 2005-09-12 10:50:00 UTC
From Bug 315669

------- Additional Comment #5 From Vasily Chekalkin 2005-09-12 09:44 UTC ------- 

Sorry, I've removed some files in my home dir and nau doesn't crash now.

But I have other dir :)

(gdb) bt
  • #0 gnome_vfs_escape_string_internal
    at gnome-vfs-utils.c line 233
  • #1 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1104
  • #2 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1995
  • #3 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 298
  • #4 gnome_vfs_find_directory
    at gnome-vfs-find-directory.c line 63
  • #5 eel_uri_is_in_trash
    at eel-vfs-extensions.c line 597
  • #6 nautilus_file_is_in_trash
    from /usr/lib/libnautilus-private.so.2
  • #7 fm_directory_view_is_read_only
  • #8 fm_directory_view_should_show_file
  • #9 fm_directory_view_supports_creating_files
  • #10 fm_directory_view_handle_text_drop
  • #11 fm_icon_view_get_type
  • #12 fm_directory_view_update_menus
  • #13 fm_directory_view_freeze_updates
  • #14 g_main_context_wakeup
    from /usr/lib/libglib-2.0.so.0
  • #15 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #16 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #17 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #18 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 main

Comment 15 Christian Kirbach 2005-09-12 10:52:43 UTC
Vasily, what files have you moved out of the way? they triggered the crash.

are any symbolic links involved?

Are there any special files in the directory that cause your crash? 
Can you please try to identify what file(s) cause the crash?
Comment 16 Christian Neumair 2005-09-12 10:58:31 UTC
Eeek, the crash is probably in

gnome_vfs_find_directory (vfs_uri, GNOME_VFS_DIRECTORY_KIND_TRASH,
                          &trash_vfs_uri, FALSE, FALSE, 0777)

from eel_uri_is_in_trash.
Comment 17 Christian Neumair 2005-09-12 11:08:04 UTC
Created attachment 52119 [details]
testing program

The attached program tries to find the trash directory for a given URI. Maybe
you could compile it with
  gcc -o testcrash testcrash.c `pkg-config --libs --cflags gnome-vfs-2.0`
and then run
  ./testcrash file:///home
?
Comment 18 Vasily Chekalkin 2005-09-12 11:57:19 UTC
Yes. I've removed 2 files: 1 link and 1 file with "broken" name.
Comment 19 Vasily Chekalkin 2005-09-12 12:00:04 UTC
bacek@bacek:~/src$ gcc -g -o testcrash testcrash.c `pkg-config --libs --cflags g
nome-vfs-2.0`
bacek@bacek:~/src$ gdb ./testcrash 
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"...Using host libthread_db library "/
lib/tls/libthread_db.so.1".

(gdb) r file:///home/bacek/src
Starting program: /opt/home/bacek/src/testcrash file:///home/bacek/src
[Thread debugging using libthread_db enabled]
[New Thread -1208104736 (LWP 16241)]
** Message: finding trash directory for file:///home/bacek/src
** Message: result: Too many links

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 16241)

  • #0 g_string_insert_len
    from /usr/lib/libglib-2.0.so.0
  • #1 g_string_append
    from /usr/lib/libglib-2.0.so.0
  • #2 gnome_vfs_uri_to_string
    at gnome-vfs-uri.c line 1223
  • #3 main
    at testcrash.c line 34

Comment 20 Vasily Chekalkin 2005-09-12 12:01:12 UTC
May be this help too.

(gdb) up
  • #1 g_string_append
    from /usr/lib/libglib-2.0.so.0
  • #2 gnome_vfs_uri_to_string
    at gnome-vfs-uri.c line 1223
  • #3 main
    at testcrash.c line 34

Comment 21 Christian Neumair 2005-09-12 12:19:36 UTC
Thanks for your quick response!

Probably two issues:
1) gnome_vfs_find_directory failed, but trash_uri is not NULL
2) The "Too many links" problem shouldn't happen. I assume you have some looped
symlinks or something (i.e. src/foo -> src/). Also, GnomeVFS should be smarter
when symlink resolution fails.

Reassigning to GnomeVFS.
Comment 22 Christian Neumair 2005-09-12 12:27:57 UTC
Created attachment 52123 [details] [review]
Proposed patch

The attached patch NULLifies *result_uri in
gnome_vfs_find_directory_cancellable before doing anything. Thus, we have it
set to NULL if the symlink resolution fails, or the operation is cancelled,
which happens before the GnomeVFSMethod->find_directory invocation. This also
fixes cases where modules don't set *result_uri to NULL if they fail.
Comment 23 Christian Neumair 2005-09-12 12:37:42 UTC
I've committed that patch. It should considerably reduce the amount of issues we
have. Vasily: Maybe you could check back what happens now in Nautilus? I suspect
the item just won't be placed in the trash.
Comment 24 Vasily Chekalkin 2005-09-12 12:40:32 UTC
I'll try gnome-vfs with this patch. But my crash wasn't releated to drag'n'drop
and trashcan. My nau crash on open directory.
Comment 25 Vasily Chekalkin 2005-09-12 12:46:32 UTC
Hmm... testcrash works.

bacek@bacek:~/src$ ./testcrash file:///home/bacek/src
** Message: finding trash directory for file:///home/bacek/src
** Message: result: Too many links

** (process:1384): WARNING **: no trash found!
bacek@bacek:~/src$

But nau still crashes.
bacek@bacek:~/src$ gdb nautilus
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/libthread_db.so.1".

(gdb) r /home/bacek/src
Starting program: /usr/bin/nautilus /home/bacek/src
...
Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 1446)

  • #0 gnome_vfs_escape_string_internal
    at gnome-vfs-utils.c line 233
  • #1 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1104
  • #2 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1995
  • #3 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 300
  • #4 gnome_vfs_find_directory
    at gnome-vfs-find-directory.c line 63
  • #5 eel_uri_is_in_trash
    at eel-vfs-extensions.c line 597
  • #6 nautilus_file_is_in_trash
    from /usr/lib/libnautilus-private.so.2
  • #7 fm_directory_view_is_read_only
  • #8 fm_directory_view_handle_text_drop
  • #9 fm_icon_view_get_type
  • #10 fm_directory_view_update_menus
  • #11 fm_directory_view_freeze_updates
  • #12 g_main_context_wakeup
    from /usr/lib/libglib-2.0.so.0
  • #13 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #14 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #15 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #16 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 main

Comment 26 Vasily Chekalkin 2005-09-12 12:50:55 UTC
Very strange...

(gdb) up
  • #1 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1104
  • #2 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1995
  • #3 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 300
$6 = (GnomeVFSURI *) 0x88e3d10
(gdb) p *near_uri
$7 = {ref_count = 2, text = 0x868a2a0 "/home/bacek", fragment_id = 0x0, 
  method_string = 0x868a898 "file", method = 0xb7c93700, parent = 0x0, 
  reserved1 = 0x2f74706f, reserved2 = 0x656d6f68}
Comment 27 Christian Neumair 2005-09-12 13:06:54 UTC
Created attachment 52126 [details]
testing program 2

Thanks again for your quick response!
The attached sample program check whether
_gnome_vfs_uri_resolve_all_symlinks_uri works correctly. If it doesn't work for
file:///home/bacek/src, I would like you to tell us some details about the type
of the src/ file, where it points to if it is a symlink, how the symlink
hierarchy proceeds etc..
Comment 28 Vasily Chekalkin 2005-09-12 13:11:12 UTC
bacek@bacek:~/src$ ./testcrash2 file:///home/bacek/src
** Message: resolving all symlinks for file:///home/bacek/src
** Message: result: Too many links

** (process:2419): WARNING **: no URI resolved!

Comment 29 Vasily Chekalkin 2005-09-12 13:12:42 UTC
Ooopps...

bacek@bacek:~/src$ gdb nautilus
GNU gdb 6.3-debian
...
(gdb) r file:///home/bacek/src
Starting program: /usr/bin/nautilus file:///home/bacek/src
...
*** glibc detected *** double free or corruption (out): 0x085f58a8 ***

Program received signal SIGABRT, Aborted.

Thread NaN (LWP 2433)

  • #0 raise
    from /lib/tls/libc.so.6
  • #1 abort
    from /lib/tls/libc.so.6
  • #2 __fsetlocking
    from /lib/tls/libc.so.6
  • #3 malloc_trim
    from /lib/tls/libc.so.6
  • #4 free
    from /lib/tls/libc.so.6
  • #5 g_free
    from /usr/lib/libglib-2.0.so.0
  • #6 gtk_label_get_mnemonic_keyval
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 gtk_label_set_label
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 gtk_action_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 g_cclosure_marshal_VOID__PARAM
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_object_interface_list_properties
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_value_get_flags
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_object_set_valist
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_object_set
    from /usr/lib/libgobject-2.0.so.0
  • #18 fm_directory_view_handle_text_drop
  • #19 fm_icon_view_get_type
  • #20 fm_directory_view_update_menus
  • #21 fm_directory_view_freeze_updates
  • #22 g_main_context_wakeup
    from /usr/lib/libglib-2.0.so.0
  • #23 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #24 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #26 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 main

Comment 30 Vasily Chekalkin 2005-09-12 13:40:11 UTC
Previous backtrace is invalid. 

Right backtrace is:

(gdb) bt
  • #0 gnome_vfs_escape_string_internal
    at gnome-vfs-utils.c line 228
  • #1 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1104
  • #2 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1995
  • #3 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 300
  • #4 gnome_vfs_find_directory
    at gnome-vfs-find-directory.c line 63
  • #5 eel_uri_is_in_trash
    at eel-vfs-extensions.c line 597
  • #6 nautilus_file_is_in_trash
    from /usr/lib/libnautilus-private.so.2
  • #7 fm_directory_view_is_read_only
  • #8 fm_directory_view_should_show_file
  • #9 fm_directory_view_supports_creating_files
  • #10 fm_directory_view_handle_text_drop
  • #11 fm_icon_view_get_type
  • #12 fm_directory_view_update_menus
  • #13 fm_directory_view_freeze_updates
  • #14 g_main_context_wakeup
    from /usr/lib/libglib-2.0.so.0
  • #15 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #16 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #17 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #18 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 main

Comment 31 Christian Neumair 2005-09-12 13:53:23 UTC
Vasily: Running testcrash2 with file:///home/bacek crashes as well, right?
Comment 32 Vasily Chekalkin 2005-09-12 13:54:56 UTC
No. testcrash2 works fine.

Seems I've found a bug. May be problem in my directory structure.

This is backtrace of another crash:

Program received signal SIGSEGV, Segmentation fault.
gnome_vfs_escape_string_internal (
    string=0x86bbedd "t/home/%25D55Kt/home/%2", '5' <repeats 177 times>..., 
    mask=UNSAFE_PATH) at gnome-vfs-utils.c:233
233                             *q++ = c;
(gdb) up
  • #1 gnome_vfs_uri_append_path
    at gnome-vfs-uri.c line 1104
  • #2 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1995
$10 = (GnomeVFSURI *) 0x83c5ff0
(gdb) p *resolved_uri 
$11 = {ref_count = 1, text = 0x8651b60 "/home/opt/home", fragment_id = 0x0, 
  method_string = 0x83a7540 "file", method = 0xb7c03700, parent = 0x0, 
  reserved1 = 0x2f74706f, reserved2 = 0x656d6f68}

This is directory layout:
bacek@bacek:/$ ls -la|grep home
lrwxrwxrwx    1 root staff     8 2005-03-02 04:10 home -> opt/home

When I invoke "$ nautilus /home/bacek/src" it freez.
OTH nautilus /opt/home/bacek/src works fine.




Comment 33 Christian Neumair 2005-09-12 14:00:53 UTC
I'm pretty much sure it works if you rm /home && ln -s /opt/home /home
Comment 34 Vasily Chekalkin 2005-09-12 14:04:01 UTC
Yes. It works. But bug is still exists :)
Comment 35 Christian Neumair 2005-09-12 14:24:45 UTC
Looks like _gnome_vfs_uri_resolve_all_symlinks_uri is hosed. I haven't
investigated it in detail, but according to some random guy on a C IRC channel
there are two types of symlinks, the ones with and the ones without a '/'
prefix. If a symlink foo *has* this prefix (foo->/opt/foo), it is meant to be
resolved to /opt/foo. If it does *not* have this prefix (foo->opt/foo), it is
meant to be resolved to opt/foo, i.e. the symlink name should replace the
basename of the symlink.

However, having the directory structure /foo->/opt/foo and invoking
_gnome_vfs_uri_resolve_all_symlinks_uri for "/foo" does not resolve to /opt/foo,
but result in an endless loop (Too many links).
Comment 36 Vasily Chekalkin 2005-09-12 14:31:53 UTC
Yeek. Basename for 'foo' is `pwd`/foo. And symlink foo->opt/foo must be resolved
into `pwd`/opt/foo.
Comment 37 Christian Neumair 2005-09-12 15:02:22 UTC
Created attachment 52129 [details] [review]
Proposed patch

Could you please check whether the attached patch helps?
Comment 38 Christian Neumair 2005-09-12 15:05:33 UTC
It will probably even be worse. Please ignore it.
Comment 39 Christian Neumair 2005-09-12 15:18:28 UTC
Created attachment 52130 [details] [review]
Proposed patch

This patch should fix both the crasher you had and symlink resolution.
Comment 40 Christian Neumair 2005-09-12 17:29:56 UTC
Vasily, can you confirm that this patch helps?
Comment 41 Christian Neumair 2005-09-12 20:17:42 UTC
Created attachment 52143 [details] [review]
Proposed patch

Thanks to Christian Kellner for tracking down a typo. This one should help.
Vasily, maybe you could try it out?
Comment 42 Vasily Chekalkin 2005-09-13 06:53:24 UTC
Still crashing...
Comment 43 Vasily Chekalkin 2005-09-13 06:56:08 UTC
Most significant part of backtrace:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 17660)

  • #0 gnome_vfs_uri_append_string
    at gnome-vfs-uri.c line 1069
  • #1 _gnome_vfs_uri_resolve_all_symlinks_uri
    at gnome-vfs-utils.c line 1997
  • #2 gnome_vfs_find_directory_cancellable
    at gnome-vfs-cancellable-ops.c line 300
  • #3 gnome_vfs_find_directory
    at gnome-vfs-find-directory.c line 63
  • #4 eel_uri_is_in_trash
    at eel-vfs-extensions.c line 597
  • #5 nautilus_file_is_in_trash

Comment 44 Kevin Brown 2005-09-13 08:10:00 UTC
Ah...it turns out my /home directory on the system I have which shows the issue
is indeed a symlink to export/home (i.e., a relative link).  When I change it to
point to /export/home instead (in other words, make it an absolute instead of
relative link), drag&drop into the trash works properly.

Sorry, symlink following is something that's been done for so long now that it
never even occurred to me to think of that as a relevant thing to report.  I
figured something like that Just Worked.  You guys might have made headway
against this issue much sooner had I reported that little detail.  :-(

Anyway, excellent work on tracking this one down thus far...
Comment 45 Christian Neumair 2005-09-13 09:56:13 UTC
Vasily: I don't get why this crashes for you. I have a directory structure like
/opt
/opt/foo
/opt/foo/foobar
/opt/foo/foobar/bar
/foo -> opt/foo

replace "foo" by "home", "foobar" by "bacek" and "bar" by "src" and this should
be your situation.

For me, my test program returns

** Message: resolving all symlinks for file:///foo/foobar/bar
** Message: result: No error
** Message: resolved to URI: file:///opt/foo/foobar/bar

Does the test program also work for you?
Comment 46 Christian Neumair 2005-09-13 10:08:55 UTC
I also find your last stack trace quiet obscure:

  • #1 _gnome_vfs_uri_resolve_all_symlinks_uri
  • #2 gnome_vfs_find_directory_cancellable

means that the URI's memory address magically changed. Maybe you could add a

  g_message ("resolving %s", gnome_vfs_uri_to_string (uri,
GNOME_VFS_URI_HIDE_NONE));

to the beginning of _gnome_vfs_uri_resolve_all_symlinks_uri and tell us *what*
uri is resolved?
Comment 47 Vasily Chekalkin 2005-09-13 10:53:54 UTC
Ок. "I know kung-fu"

(gdb) r
Starting program: /usr/bin/nautilus file:///home/bacek/src
...
Breakpoint 1 at 0xb7f36585: file gnome-vfs-utils.c, line 1993.
libgnomevfs-Message: resolving file:///usr
[New Thread -1216754768 (LWP 11151)]
[New Thread -1217016912 (LWP 11152)]
libgnomevfs-Message: resolving file:///opt
libgnomevfs-Message: resolving file:///
libgnomevfs-Message: resolving file:///home/bacek
[Switching to Thread -1209104704 (LWP 11143)]

Breakpoint 1, _gnome_vfs_uri_resolve_all_symlinks_uri (uri=0x8518968, 
    result_uri=0xbfd68018) at gnome-vfs-utils.c:1993
1993                            new_uri_parent = gnome_vfs_uri_get_parent (uri);
(gdb) p *uri
$1 = {ref_count = 3, text = 0x875b3a8 "/home/bacek", fragment_id = 0x0, 
  method_string = 0x850ddd8 "file", method = 0xb7cc9700, parent = 0x0, 
  reserved1 = 0x85188d0, reserved2 = 0x85186c8}
(gdb) n
1994                            resolved_uri = gnome_vfs_uri_resolve_relative
(new_uri_parent,
(gdb) n
1996                            gnome_vfs_uri_unref (new_uri_parent);
(gdb) p *resolved_uri 
$2 = {ref_count = 1, text = 0x8518908 "/home/opt/home", fragment_id = 0x0, 
  method_string = 0x85166d8 "file", method = 0xb7cc9700, parent = 0x0, 
  reserved1 = 0x2f554e47, reserved2 = 0x756e694c}
(gdb) n

I think that "/home/opt/home" is wrong.

testcrash2 crashes too.
Comment 48 Christian Neumair 2005-09-13 13:42:15 UTC
Thanks for your extensive feedback!
What is the value of p before resolved_uri is initialized?
Comment 49 Vasily Chekalkin 2005-09-13 13:52:06 UTC
bacek@bacek:~/src$ gdb ./testcrash2 
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"...Using host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) b gnome-vfs-utils.c:1967
(gdb) r /home/bacek/src
Starting program: /opt/home/bacek/src/testcrash2 /home/bacek/src
Breakpoint 2, _gnome_vfs_uri_resolve_all_symlinks_uri (uri=0x8070ec0, 
    result_uri=0xbf7fe4a8) at gnome-vfs-utils.c:1967
1967            p = uri->text;
(gdb) n
1969            while (*p != 0) {
(gdb) p p
$1 = 0x8071a00 "/home/bacek/src"
(gdb) n

...

(gdb) p p
$2 = 0x8071a05 "/bacek/src"
(gdb) n
1979                    gnome_vfs_file_info_clear (info);
(gdb) 
1980                    res = gnome_vfs_get_file_info_uri (new_uri, info,
GNOME_VFS_FILE_INFO_DEFAULT);
(gdb) 
1981                    if (res != GNOME_VFS_OK) {
(gdb) 
1985                    if (info->type == GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK &&
(gdb) 
1987                            n_followed_symlinks++;
(gdb) 
1988                            if (n_followed_symlinks > MAX_SYMLINKS_FOLLOWED) {
(gdb) 
1993                            new_uri_parent = gnome_vfs_uri_get_parent (uri);
(gdb) 
1994                            resolved_uri = gnome_vfs_uri_resolve_relative
(new_uri_parent,
(gdb) p *new_uri_parent 
$3 = {ref_count = 1, text = 0x8057bc0 "/home/bacek", fragment_id = 0x0, 
  method_string = 0x8057c00 "file", method = 0xb7efd700, parent = 0x0, 
  reserved1 = 0x0, reserved2 = 0x0}
(gdb) n
1996                            gnome_vfs_uri_unref (new_uri_parent);
(gdb) p *resolved_uri 
$4 = {ref_count = 1, text = 0x8086318 "/home/opt/home", fragment_id = 0x0, 
  method_string = 0x8057cc8 "file", method = 0xb7efd700, parent = 0x0, 
  reserved1 = 0x0, reserved2 = 0x0}
Comment 50 Christian Neumair 2005-09-13 14:00:26 UTC
You still use my old, obsolete patch (attachment 52130 [details] [review]):
  new_uri_parent = gnome_vfs_uri_get_parent (uri);
If you use attachment 52143 [details] [review] instead, this line will be:
  new_uri_parent = gnome_vfs_uri_get_parent (new_uri);
Comment 51 Christian Neumair 2005-09-13 14:03:17 UTC
btw. I've just tested mv /home /opt/home && ln -s opt/home /home, and it seems
to work like a charm :).
Comment 52 Vasily Chekalkin 2005-09-13 14:14:01 UTC
Yes!!! It works!!!

BTW, 
bacek@bacek:~$ ./src/testcrash2 src
** Message: resolving all symlinks for file:src
libgnomevfs-Message: resolving file:src
** Message: result: Invalid URI

** (process:31838): WARNING **: no URI resolved!

Is this behavior correct?
Comment 53 Christian Neumair 2005-09-13 16:36:58 UTC
Vasily: Yes, this is at least partially correct. The application was written so
that it takes a full URI. However, it obviously tries to construct a weirdo
file:yourinput URI if it fails.

I've committed the patch that helps, which will also be incorporated in GnomeVFS
2.12. Thus, I'm marking this bug as FIXED.

Kevin: If you still get this issue, please reopen this bug report.
Comment 54 Christian Neumair 2005-09-14 00:18:26 UTC
*** Bug 312536 has been marked as a duplicate of this bug. ***
Comment 55 Martin Wehner 2006-03-18 06:02:16 UTC
*** Bug 334712 has been marked as a duplicate of this bug. ***