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 613399 - gvfsd-(sftp/ftp) hang on 100%CPU if they try to read password from gnome-keyring
gvfsd-(sftp/ftp) hang on 100%CPU if they try to read password from gnome-keyring
Status: RESOLVED DUPLICATE of bug 606902
Product: libgnome-keyring
Classification: Core
Component: General
git master
Other Linux
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-03-20 11:26 UTC by schrott4711
Modified: 2019-02-22 11:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb backtrace of hanging gvfsd-sftp (6.94 KB, text/plain)
2010-03-20 11:26 UTC, schrott4711
  Details
improved backtrace (10.61 KB, text/plain)
2010-03-25 16:26 UTC, schrott4711
  Details
Possible fix for the problem (770 bytes, patch)
2010-03-27 03:15 UTC, Stef Walter
none Details | Review

Description schrott4711 2010-03-20 11:26:54 UTC
Created attachment 156615 [details]
gdb backtrace of hanging gvfsd-sftp

Tested on ubuntu 10.04 
Version gvfs-1.5.5-0ubuntu1

If you try to connect to a sftp / ftp share via a password the gvfsd-(sftp/ftp) process hangs without results at 90-100%.
This only happens if you have been connected to the share before and the password is stored in the gnome-keyring. (View with seahorse).

Steps to reproduce:
1) Connect to a server (you haven't connected before) and select "forget password immediatly". The share will be mounted successfully.
Disconnect from the server.
2) Connect to a server and select "store password forever". The share won't be mounted and gvfsd-xx will eat your cpu.
As long as the password is stored you won't be able to connect. Delete the password (seahorse) and you will be able to do 1).
Comment 1 schrott4711 2010-03-25 16:26:07 UTC
Created attachment 157080 [details]
improved backtrace

improved backtrace. Does anyone care?
Comment 2 Stef Walter 2010-03-27 03:15:37 UTC
Created attachment 157245 [details] [review]
Possible fix for the problem

Here's a possible fix for this problem. Are either of you willing to get into building libgnome-keyring from source?
Comment 3 Sebastien Bacher 2010-03-29 14:39:59 UTC
The change seems to solve some issues but not be enough to be working correctly, see https://bugs.edge.launchpad.net/ubuntu/+source/libgnome-keyring/+bug/530605/comments/25

The issue is probably the same as bug #611584 there?
Comment 4 Sebastien Bacher 2010-03-29 15:44:27 UTC
other comments suggest the change is not working
Comment 5 Hiroyuki Ikezoe 2010-04-02 03:39:02 UTC
Review of attachment 157245 [details] [review]:

::: library/gkr-operation.c
@@ +256,3 @@
+	if (g_once_init_enter (&inited_threads)) {
+		if (g_thread_supported ())
+			dbus_threads_init_default ();

gvfs daemons seem to call this already. See
http://git.gnome.org/browse/gvfs/tree/daemon/daemon-main.c?h=gnome-2-28#n65

And D-Bus document says that "dbus_threads_init/init_default must be called BEFORE the second thread is started", so calling it in here may be late.
Comment 6 Stef Walter 2010-04-08 17:09:47 UTC
I'm hoping to get to the bottom of this before 2.30.1.

I've tried again to duplicate this issue but have not been able to. Does anyone have time and expertise to debug this issue in a debugger and step around and answer the following questions:

Where does the loop in gvfsd occur? In other words which of the following functions are running during the loop?

 __pthread_mutex_unlock_usercnt
 _dbus_pthread_mutex_unlock
 _dbus_mutex_unlock
 _dbus_connection_unlock
 dbus_pending_call_get_completed
 _dbus_connection_block_pending_call
 dbus_pending_call_block
 gkr_operation_block

Secondly is the mutex being passed to _dbus_mutex_unlock really NULL? I see this in the stack trace:

  • #1 _dbus_pthread_mutex_unlock
    at dbus-sysdeps-pthread.c line 187
  • #2 _dbus_mutex_unlock
    at dbus-threads.c line 165

Comment 7 Sebastien Bacher 2010-04-08 20:10:57 UTC
Stef, not sure if the workaround on https://bugzilla.gnome.org/show_bug.cgi?id=606902 could give you useful information but ubuntu lucid is using it now and it seems to make the gvfs cpu usage better

the ubuntu bug has a collection of issues, the gvfs one seems fixed by the workaround but some users still get issues in gvfs or say seahorse uses cpu too.

there was another class of issues which started with the new libgnome-keyring version too coming from software using gnome-keyring in threads, it seems using libdbus or libdbus-glib is such context is an issue
Comment 8 Sebastien Bacher 2010-04-08 20:12:14 UTC
the bug with the workaround point to dbus bugs which might be interesting too...
Comment 9 Stef Walter 2010-04-09 18:49:53 UTC

*** This bug has been marked as a duplicate of bug 606902 ***
Comment 10 Vincent Gerris 2010-04-13 14:17:46 UTC
I still have a mount problem in ubuntu when trying to store the password, so the CPU issue in Lucid is not here, the password / keyring problem is.

If any1 needs traces, please tell me the commands to use, since I have the tools installed, but have not found out (yet) how to debug this issue.