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 161997 - gnome-vfs-daemon blocked in a mutex when hal restarts
gnome-vfs-daemon blocked in a mutex when hal restarts
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Other
2.9.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 163579 163942 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-12-22 16:10 UTC by Vincent Untz
Modified: 2005-01-31 11:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possible fix (857 bytes, patch)
2005-01-18 10:04 UTC, Alexander Larsson
none Details | Review

Description Vincent Untz 2004-12-22 16:10:06 UTC
(gnome-vfs 2.9.2)

When hal is restarted, gnome-vfs-daemon seems to be blocked in a mutex. Many
applications are then blocked too (probably in gnome_vfs_get_volume_monitor)

Here's a stack trace:

(gdb) bt
  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 __lll_mutex_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #5 _L_mutex_lock_26
    from /lib/tls/i686/cmov/libpthread.so.0
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
    from /usr/lib/libgobject-2.0.so.0
  • #10 __JCR_LIST__
    from /usr/lib/libgnomevfs-2.so.0
  • #11 ??
  • #12 ??
  • #13 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 244
  • #14 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 244
  • #15 gnome_vfs_get_volume_monitor
    at gnome-vfs-volume-monitor.c line 277
  • #16 gnome_vfs_daemon_get_type
  • #17 _ORBIT_skel_small_GNOME_VFS_Daemon_getDrives
  • #18 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #19 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #20 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #21 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #22 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #23 giop_thread_queue_process
    from /usr/lib/libORBit-2.so.0
  • #24 giop_recv_buffer_get
    from /usr/lib/libORBit-2.so.0
  • #25 ORBit_small_invoke_stub
    from /usr/lib/libORBit-2.so.0
  • #26 ORBit_small_invoke_stub_n
    from /usr/lib/libORBit-2.so.0
  • #27 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #28 ConfigServer_ping
    from /usr/lib/libgconf-2.so.4
  • #29 gconf_activate_server
    from /usr/lib/libgconf-2.so.4
  • #30 gconf_engine_key_is_writable
    from /usr/lib/libgconf-2.so.4
  • #31 gconf_engine_key_is_writable
    from /usr/lib/libgconf-2.so.4
  • #32 gconf_engine_pop_owner_usage
    from /usr/lib/libgconf-2.so.4
  • #33 gconf_engine_get_default
    from /usr/lib/libgconf-2.so.4
  • #34 gconf_client_get_default
    from /usr/lib/libgconf-2.so.4
  • #35 gnome_vfs_volume_monitor_daemon_get_type
  • #36 g_type_create_instance
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_object_new_valist
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_object_newv
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_object_new_valist
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_object_new
    from /usr/lib/libgobject-2.0.so.0
  • #41 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 250
  • #42 gnome_vfs_get_volume_monitor
    at gnome-vfs-volume-monitor.c line 277
  • #43 gnome_vfs_daemon_get_type
  • #44 _ORBIT_skel_small_GNOME_VFS_Daemon_getDrives
  • #45 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #46 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #47 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #48 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #49 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #50 giop_thread_queue_process
    from /usr/lib/libORBit-2.so.0
  • #51 giop_thread_same_key
    from /usr/lib/libORBit-2.so.0
  • #52 link_servers_move_io_T
    from /usr/lib/libORBit-2.so.0
  • #53 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #54 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #55 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #56 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #57 bonobo_main
    from /usr/lib/libbonobo-2.so.0
  • #58 main

Comment 1 Christophe Fergeau 2004-12-22 18:21:13 UTC
Lowering priority since this happens when the hal backend is enabled, and it's
not enabled by default.
Can you get a backtrace for the other threads ? (thread apply all bt)
Fwiw, I tried to restart hal (or rather to do a /etc/init.d/dbus restart on a
debian sid system) with gnome-vfs head compiled with ahl support about a week
ago, and I didn't manage to hang gnome-vfs-daemon.
Comment 2 Vincent Untz 2004-12-23 07:31:21 UTC
(gdb) thread apply all bt

Thread 2 (Thread -1216922704 (LWP 1680))

  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 poll
    from /lib/tls/i686/cmov/libc.so.6
  • #5 g_main_loop_get_context
    from /usr/lib/libglib-2.0.so.0
  • #6 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #7 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #8 link_thread_io_context
    from /usr/lib/libORBit-2.so.0
  • #9 ??
    from /usr/lib/libglib-2.0.so.0
  • #10 ??
  • #11 g_static_private_free
    from /usr/lib/libglib-2.0.so.0
  • #0 ??

I can't get anything better than this...
Steps to reproduce:
 * /etc/init.d/dbus stop
 * kill gnome-vfs-daemon. A new gnome-vfs-daemon should be automatically spawned.
 * /etc/init.d/dbus start

It's not always possible to reproduce, but sometimes it works.
Comment 3 Christophe Fergeau 2005-01-13 19:25:12 UTC
*** Bug 163942 has been marked as a duplicate of this bug. ***
Comment 4 Sebastien Bacher 2005-01-14 00:51:22 UTC
I just got this strace with GNOME 2.9.4 and gnomevfs built without hal while
opening a gdmflexiserver with an another user on my box
Comment 5 Sebastien Bacher 2005-01-17 21:25:10 UTC
(gdb) bt full
  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 __lll_mutex_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #5 _L_mutex_lock_26
    from /lib/tls/i686/cmov/libpthread.so.0
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 __JCR_LIST__
    from /usr/lib/libgnomevfs-2.so.0
  • #11 ??
  • #12 ??
  • #13 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 244
  • #14 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 244
  • #15 gnome_vfs_get_volume_monitor
    at gnome-vfs-volume-monitor.c line 277
  • #16 register_volume_monitor
    at gnome-vfs-daemon.c line 306
  • #17 _ORBIT_skel_small_GNOME_VFS_Daemon_registerVolumeMonitor
    at ../libgnomevfs/GNOME_VFS_Daemon-common.c line 92
  • #18 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #19 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #20 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #21 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #22 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #23 giop_thread_queue_process
    from /usr/lib/libORBit-2.so.0
  • #24 giop_recv_buffer_get
    from /usr/lib/libORBit-2.so.0
  • #25 ORBit_small_invoke_stub
    from /usr/lib/libORBit-2.so.0
  • #26 ORBit_small_invoke_stub_n
    from /usr/lib/libORBit-2.so.0
  • #27 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #28 ConfigServer_ping
    from /usr/lib/libgconf-2.so.4
  • #29 gconf_activate_server
    from /usr/lib/libgconf-2.so.4
  • #30 gconf_engine_key_is_writable
    from /usr/lib/libgconf-2.so.4
  • #31 gconf_engine_key_is_writable
    from /usr/lib/libgconf-2.so.4
  • #32 gconf_engine_pop_owner_usage
    from /usr/lib/libgconf-2.so.4
  • #33 gconf_engine_get_default
    from /usr/lib/libgconf-2.so.4
  • #34 gconf_client_get_default
    from /usr/lib/libgconf-2.so.4
  • #35 gnome_vfs_volume_monitor_daemon_init
    at gnome-vfs-volume-monitor-daemon.c line 173
  • #36 g_type_create_instance
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_object_new_valist
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_object_newv
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_object_new_valist
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_object_new
    from /usr/lib/libgobject-2.0.so.0
  • #41 _gnome_vfs_get_volume_monitor_internal
    at gnome-vfs-volume-monitor.c line 250
  • #42 gnome_vfs_get_volume_monitor
    at gnome-vfs-volume-monitor.c line 277
  • #43 register_volume_monitor
    at gnome-vfs-daemon.c line 306
  • #44 _ORBIT_skel_small_GNOME_VFS_Daemon_registerVolumeMonitor (_o_servant=0x80aa6cc, _o_retval=0x0,
  • #45 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #46 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #47 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #48 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #49 ORBit_recv_buffer_return_sys_exception
    from /usr/lib/libORBit-2.so.0
  • #50 giop_thread_queue_process
    from /usr/lib/libORBit-2.so.0
  • #51 giop_thread_same_key
    from /usr/lib/libORBit-2.so.0
  • #52 link_servers_move_io_T
    from /usr/lib/libORBit-2.so.0
  • #53 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #54 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #55 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #56 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #57 bonobo_main
    from /usr/lib/libbonobo-2.so.0
  • #58 main
    at gnome-vfs-daemon.c line 612

Comment 6 Christophe Fergeau 2005-01-18 00:08:09 UTC
Hrm, could this be an ORBit/bonobo bug? My understanding of this backtrace is
that the client calls the registerVolumeMonitor method on the daemon. The daemon
executes that method, and to do that, it needs to create a
GnomeVFSVolumeMonitorDaemon object. In the _init method for this gobject,
gconf_client_get_default is called. This causes another remote method
(ConfigServer_ping ?) to be called, this time on the gconf daemon. But for some
reason, registerVolumeMonitor gets called again (instead of the appropriate
method on the gconf daemon), which causes the deadlock since the
the_volume_monitor lock is held and hasn't been released yet.
Dunno if I'm making sense, I'm tired and have drunk a bit too much, Alex will
have to look at it anyway...
Comment 7 Alexander Larsson 2005-01-18 09:58:47 UTC
Ah, this is a corba reentrancy issue.
While we're handling the first registerVolumeMonitor another one arrives, and
when we call out using corba to gconfd we'll start handling the second one.

One could possibly move registerVolumeMonitor() to AsyncDaemon, which is
registered to launch a new thread per request. However, the whole locking scheme
for volumes/drives is built upon changes only happening in the main thread, so
that would require a massive redesign of that locking. Long term that might be
nice anyway, to allow changing GnomeVFSVolumes after construction (not currently
allowed due to locking scheme) but it sounds a bit much right now.

A possible solution is to create the volume daemon in main() to avoid the gconf
call.
Comment 8 Alexander Larsson 2005-01-18 10:04:21 UTC
Created attachment 36164 [details] [review]
Possible fix

Can someone please test this patch and see if it fixes the issue?
Comment 9 Alexander Larsson 2005-01-18 19:05:00 UTC
i commited this, because i do think its right, and i don't want to forget it.
I'd still like someone to verify that it indeed fixes it though.
Comment 10 Sebastien Bacher 2005-01-18 19:10:45 UTC
I've added it to the hoary package today. It fixed the issue for one guy who had
it, but since that's a pretty random bug I'm not sure if that's just a luck or
the patch. I've asked for feedback from all the users having the bug, I'll let
you know if somebody still get the issue with it (quite a lot of people had it
randomly before).
Comment 11 Fabian Sturm 2005-01-20 12:42:31 UTC
*** Bug 163579 has been marked as a duplicate of this bug. ***
Comment 12 Sebastien Bacher 2005-01-31 11:18:30 UTC
no lock in 2 weeks with the patch, the bug seems to be fixed, I'm closing it.