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 567664 - Properly implement unmounting
Properly implement unmounting
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: webdav backend
1.0.x
Other All
: Normal normal
: ---
Assigned To: Christian Kellner
gvfs-maint
: 582128 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-01-13 21:55 UTC by Jasper Lievisse Adriaanse
Modified: 2011-06-05 11:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Change the unmount service function of webdav backend (907 bytes, patch)
2009-08-07 08:06 UTC, Jeff Cai
none Details | Review
Properly implement unmount (2.13 KB, patch)
2011-05-22 13:01 UTC, Christian Kellner
none Details | Review

Description Jasper Lievisse Adriaanse 2009-01-13 21:55:07 UTC
Please describe the problem:
After successfully mounting a webdav share, I am able to browse this.
But once I eject this share, the desktop becomes unresponsive and nautilus goes into 100% CPU usage.

The share I've connected to didn't require a login, nor was it over a secured connection.



Steps to reproduce:
1. Connect to a webdav share, like dav://webdav.schlitt.info/
2. Try to unmount/eject this share.
3. Fire up top(1) and watch nautilus eating the CPU.


Actual results:
The nautilus process hangs.

Expected results:
webdav share gets properly ejected and no hanging processes.

Does this happen every time?
Yes.

Other information:
This is on OpenBSD with the following relevant modules installed:
glib2: 2.18.4
gtk+2: 2.14.7
gvfs: 1.0.3
nautilus: 2.24.2

Solaris seems to be having a similar issue: http://defect.opensolaris.org/bz/show_bug.cgi?id=4915
Comment 1 Cosimo Cecchi 2009-01-28 18:19:52 UTC
-> gvfs

This should be a bug in the WebDAV GVfs backend.
Comment 2 Antoine Jacoutot 2009-01-31 09:20:35 UTC
I confirm this (mis)behaviour on OpenBSD-current with a GNOME 2.24 Desktop.
Comment 3 Mads Chr. Olesen 2009-02-02 08:16:29 UTC
On Ubuntu 8.10 this bug is NOT present.

glib2: 2.18.2-0ubuntu2
gvfs: 1.0.2-0ubuntu1
nautilus: 1:2.24.1-0ubuntu2
Comment 4 Alexander Larsson 2009-03-05 15:01:40 UTC
Can't reproduce with svn trunk. Can you try to get a backtrace from nautilus when this is happening? (attach to the process with gdb)
Comment 5 Antoine Jacoutot 2009-03-22 10:28:00 UTC
Here's a backtrace. I'm not sure it contains any interesting things though.
After a while, nautilus cpu goes back down to 0% and the process STATE under top(1) is "stop".



(gdb) bt full
  • #0 mutex_unlock_common
    at /usr/src/lib/libpthread/uthread/uthread_mutex.c line 770
  • #1 pthread_mutex_unlock
    at /usr/src/lib/libpthread/uthread/uthread_mutex.c line 683
  • #2 IA__g_main_context_prepare
    at gmain.c line 2462
  • #3 g_main_context_iterate
    at gmain.c line 2758
  • #4 IA__g_main_loop_run
    at gmain.c line 2986
  • #5 IA__gtk_main
    at gtkmain.c line 1200
  • #6 main
    at nautilus-main.c line 596

Comment 6 Alexander Larsson 2009-03-23 07:10:49 UTC
In fact, that is not so interesting. It just shows the main thread being idle. Maybe some other thread is spinning though. Can you try

thread apply bt full
Comment 7 Antoine Jacoutot 2009-03-23 10:12:19 UTC
`thread apply bt full' gives no output at all.
Comment 8 Alexander Larsson 2009-03-23 10:57:13 UTC
Sorry, "thread apply all bt full"
Comment 9 Antoine Jacoutot 2009-03-23 12:25:04 UTC
Here you go.

(gdb) thread apply all bt full

Thread 1 (process 11334, thread 0x8b852c00)

  • #0 _thread_kern_sched
    at /usr/src/lib/libpthread/uthread/uthread_kern.c line 482
  • #1 _thread_kern_sched_state_unlock
    at /usr/src/lib/libpthread/uthread/uthread_kern.c line 581
  • #2 pthread_cond_timedwait
    at /usr/src/lib/libpthread/uthread/uthread_cond.c line 431
  • #3 _thread_gc
    at /usr/src/lib/libpthread/uthread/uthread_gc.c line 181
  • #4 _thread_start
    at /usr/src/lib/libpthread/uthread/uthread_create.c line 240
  • #5 ??
  • #6 ??
  • #0 poll
    from /usr/lib/libc.so.50.1

Comment 10 Alexander Larsson 2009-03-24 09:41:44 UTC
I don't see anything that particularly looks like a 100% cpu loop in that.

Maybe attaching with gdb breaks the loop?
Comment 11 Antoine Jacoutot 2009-03-24 09:59:10 UTC
Actually, yes it does. As soon as I attached the process to gdb, then cpu goes back to 0% (or so).

These look suspicious:

        startup_id = 0x1 <Address 0x1 out of bounds>
        autostart_id = 0x1 <Address 0x1 out of bounds>
Comment 12 Alexander Larsson 2009-03-24 10:54:36 UTC
Well, gdb will freeze the process. Does it still run at 0% if you continue in gdb or de-attach?

wrt to the 0x1 strings, things like this are generally just gdb sucking. However, if you suspect memory corruption, try running in valgrind.
Comment 13 Antoine Jacoutot 2009-03-25 11:33:03 UTC
If I detach the process from gdb, then it goes back to 100%.
Running under valgrind is a no-go as it does not work under OpenBSD.
Comment 14 Ghee Teo 2009-07-20 12:00:53 UTC
I am seeing the same problem on OpenSolaris with 
nautilus 2.26.2 also.
The webdav mount can be browsed but when the eject book mark is clicked on, the gvfsd-dav process exists but then nautilus seems to spin as described.

Though I noticed something else also, when I click on the mount under Places, I got an error,

Could not display "davs://dev.storage.network.com/".
Error: HTTP Error: Moved Temporarily
Please select another viewer and try again.

[OK]

I wonder is that because there is a mismatch between what is mounted and what it tried to unmount that causes the spinning of nautilus.
Comment 15 Jeff Cai 2009-07-21 08:39:34 UTC
(In reply to comment #14)
> I am seeing the same problem on OpenSolaris with 
> nautilus 2.26.2 also.
> The webdav mount can be browsed but when the eject book mark is clicked on, the
> gvfsd-dav process exists but then nautilus seems to spin as described.
> 
> Though I noticed something else also, when I click on the mount under Places, I
> got an error,
> 
> Could not display "davs://dev.storage.network.com/".
> Error: HTTP Error: Moved Temporarily
> Please select another viewer and try again.
> 
> [OK]

I've filed another bug http://bugzilla.gnome.org/show_bug.cgi?id=589221 for this issue, and a patch also was attached.
Comment 16 Antoine Jacoutot 2009-07-21 09:13:40 UTC
> I've filed another bug http://bugzilla.gnome.org/show_bug.cgi?id=589221 for
> this issue, and a patch also was attached.

Unfortunately, this does not resolve the original issue about nautilus going into 100% CPU usage.
Comment 17 Jeff Cai 2009-07-21 09:22:39 UTC
(In reply to comment #16)
> > I've filed another bug http://bugzilla.gnome.org/show_bug.cgi?id=589221 for
> > this issue, and a patch also was attached.
> 
> Unfortunately, this does not resolve the original issue about nautilus going
> into 100% CPU usage.
> 

You are right. I'm working on this issue.

Comment 18 Jeff Cai 2009-07-21 09:29:26 UTC
*** Bug 582128 has been marked as a duplicate of this bug. ***
Comment 19 Jeff Cai 2009-08-04 10:18:43 UTC
Using dbus-monitor to view the messages when clicking 'unmount' menu command.
Following is the output of dbus-monitor --sesssion

signal sender=org.freedesktop.DBus -> dest=(null destination) serial=12
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=NameOwnerChanged
   string ":1.249"
   string ":1.249"
   string ""
signal sender=:1.7 -> dest=(null destination) serial=841
path=/org/gtk/vfs/mounttracker; interface=org.gtk.vfs.MountTracker;
member=unmounted
   struct {
      string ":1.249"
      object path "/org/gtk/vfs/mount/1"
      string "WebDAV on storage.network.com"
      string "WebDAV on storage.network.com"
      string ""
      string ". GThemedIcon folder-remote folder"
method call sender=:1.78 -> dest=org.gtk.vfs.Daemon serial=53
path=/org/gtk/vfs/mounttracker; interface=org.gtk.vfs.MountTracker;
member=lookupMount
error sender=:1.7 -> dest=:1.78
error_name=org.glib.GError.g_2Dio_2Derror_2Dquark.c16 reply_serial=53
   string "The specified location is not mounted"
method call sender=:1.78 -> dest=org.gtk.vfs.Daemon serial=54
path=/org/gtk/vfs/mounttracker; interface=org.gtk.vfs.MountTracker;
member=lookupMount

error sender=:1.7 -> dest=:1.78
error_name=org.glib.GError.g_2Dio_2Derror_2Dquark.c16 reply_serial=54
   string "The specified location is not mounted"

The unmount method on the daemon is not called successfully, it looks the
'unmount' dbus method is not even called. When the daemon received the
'NameOwnerChanged' message, it sends 'unmounted' signal immediately. This looks
weird.
Comment 20 Jeff Cai 2009-08-07 07:40:22 UTC
Nautilus calls a DBus method 'G_VFS_DBUS_MOUNT_OP_UNMOUNT' of gvfsd_webdav to unmount the webdav mount. But the expected reply never come. 

The server should not call 'exit(0)' to exit the process directly. It should give an reply and before exiting.
Comment 21 Jeff Cai 2009-08-07 08:06:43 UTC
Created attachment 140094 [details] [review]
Change the unmount service function of webdav backend

This can solve the hang issue of Nautilus. But Nautilus window doesn't refresh after receiving 'unmounted' signal. This should be another bug.
Comment 22 Antoine Jacoutot 2009-08-07 08:41:49 UTC
(In reply to comment #21)
> Created an attachment (id=140094) [edit]
> Change the unmount service function of webdav backend
> 
> This can solve the hang issue of Nautilus. But Nautilus window doesn't refresh
> after receiving 'unmounted' signal. This should be another bug.
> 

This fixes the issue for me on OpenBSD.
On a side note, nautilus refreshes fine here. Thank you!
Comment 23 Christian Kellner 2011-05-22 13:01:47 UTC
Created attachment 188334 [details] [review]
Properly implement unmount
Comment 24 Antoine Jacoutot 2011-05-23 22:41:52 UTC
(In reply to comment #23)
> Created an attachment (id=188334) [details] [review]
> Properly implement unmount

This works (OpenBSD) for me, thanks!
Comment 25 Christian Kellner 2011-05-24 22:54:27 UTC
We (Alex) and myself are currently trying to implement this in a generic way for all backends (trying to fix bug 509606); but it is tricky to get all the stuff right and race-free. It will make the 3.2 release though, I hope.
Thanks for looking at the Antoine!
Comment 26 Christian Kellner 2011-06-05 11:40:49 UTC
I removed the custom unmount code (6abbff2a11c28660a090e8b9398fb19332380094) from the dav backend for now since just calling exit() is clearly wrong anyway. We will pick up the auto-busy umount code once bug 509606 is fixed.