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 670515 - Deadlock when g_socket_address_get_type() is called by two threads at the same time
Deadlock when g_socket_address_get_type() is called by two threads at the sam...
Status: RESOLVED DUPLICATE of bug 670479
Product: glib
Classification: Platform
Component: gobject
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-02-21 08:15 UTC by Carlos Garcia Campos
Modified: 2012-02-21 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Carlos Garcia Campos 2012-02-21 08:15:13 UTC
I tried to isolate the problem in a simple test case but I haven't managed to reproduce the issue. This affected WebKit2 WebProcess when g_socket_new_from_fd() is called from one thread (g_socket_class_init() calls g_socket_address_get_type() when installing the load-adress property) and g_bus_get_sync() from another (the soup proxy resolver feature tries to connect to dconf to get proxy settings). See the bt:

(gdb) thread apply all bt

Hilo 4 (Thread 0xb34ecb70 (LWP 736)):
  • #0 ??
    from /lib/ld-linux.so.2
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S line 169
  • #2 __pthread_cond_wait
    at forward.c line 139
  • #3 WTF::TCMalloc_PageHeap::scavengerThread()
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libjavascriptcoregtk-3.0.so.0
  • #4 WTF::TCMalloc_PageHeap::runScavengerThread(void*)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libjavascriptcoregtk-3.0.so.0
  • #5 start_thread
    at pthread_create.c line 304
  • #6 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 ??
    from /lib/ld-linux.so.2
  • #1 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S line 142
  • #2 _L_lock_786
    from /lib/i386-linux-gnu/libpthread.so.0
  • #3 __pthread_mutex_lock
    at pthread_mutex_lock.c line 82
  • #4 pthread_mutex_lock
    at forward.c line 182
  • #5 g_rec_mutex_lock
    at gthread-posix.c line 377
  • #6 g_type_add_interface_static
    at gtype.c line 2820
  • #7 g_socket_address_get_type
    at gsocketaddress.c line 72
  • #8 g_unix_socket_address_get_type
    at gunixsocketaddress.c line 60
  • #9 g_unix_socket_address_new_with_type
    at gunixsocketaddress.c line 426
  • #10 g_dbus_address_connect
    at gdbusaddress.c line 569
  • #11 g_dbus_address_try_connect_one
    at gdbusaddress.c line 767
  • #12 g_dbus_address_get_stream_sync
    at gdbusaddress.c line 961
  • #13 initable_init
    at gdbusconnection.c line 2528
  • #14 g_initable_init
    at ginitable.c line 115
  • #15 g_bus_get_sync
    at gdbusconnection.c line 6794
  • #16 ??
    from /usr/lib/gio/modules/libdconfsettings.so
  • #17 ??
    from /usr/lib/gio/modules/libdconfsettings.so
  • #18 g_idle_dispatch
    at gmain.c line 4629
  • #19 g_main_dispatch
    at gmain.c line 2510
  • #20 g_main_context_dispatch
    at gmain.c line 3047
  • #21 g_main_context_iterate
    at gmain.c line 3118
  • #22 g_main_context_iterate
    at gmain.c line 3055
  • #23 g_main_loop_run
    at gmain.c line 3312
  • #24 ??
    from /usr/lib/gio/modules/libdconfsettings.so
  • #25 g_thread_proxy
    at gthread.c line 801
  • #26 start_thread
    at pthread_create.c line 304
  • #27 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 ??
    from /lib/ld-linux.so.2
  • #1 __GI___poll
    at ../sysdeps/unix/sysv/linux/poll.c line 87
  • #2 g_poll
    at gpoll.c line 132
  • #3 g_main_context_poll
    at gmain.c line 3412
  • #4 g_main_context_iterate
    at gmain.c line 3113
  • #5 g_main_context_iterate
    at gmain.c line 3055
  • #6 g_main_loop_run
    at gmain.c line 3312
  • #7 WorkQueue::workQueueThreadBody()
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #8 WorkQueue::startWorkQueueThread(WorkQueue*)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #9 WTF::threadEntryPoint(void*)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libjavascriptcoregtk-3.0.so.0
  • #10 WTF::wtfThreadEntryPoint(void*)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libjavascriptcoregtk-3.0.so.0
  • #11 start_thread
    at pthread_create.c line 304
  • #12 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 ??
    from /lib/ld-linux.so.2
  • #1 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S line 169
  • #2 __pthread_cond_wait
    at forward.c line 139
  • #3 g_cond_wait
    at gthread-posix.c line 746
  • #4 g_once_init_enter
    at gthread.c line 686
  • #5 g_socket_address_get_type
    at gsocketaddress.c line 72
  • #6 g_socket_class_init
    at gsocket.c line 825
  • #7 g_socket_class_intern_init
    at gsocket.c line 125
  • #8 type_class_init_Wm
    at gtype.c line 2219
  • #9 g_type_class_ref
    at gtype.c line 2925
  • #10 g_object_new_valist
    at gobject.c line 1791
  • #11 g_initable_new_valist
    at ginitable.c line 224
  • #12 g_initable_new
    at ginitable.c line 148
  • #13 g_socket_new_from_fd
    at gsocket.c line 1032
  • #14 WorkQueue::registerEventSourceHandler(int, int, WTF::Function<void ()> const&)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #15 CoreIPC::Connection::open()
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #16 WebKit::WebProcess::initialize(int, WebCore::RunLoop*)
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #17 WebProcessMainGtk
    from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/.libs/libwebkit2gtk-3.0.so.0
  • #18 main

See the original bug report for further info:

https://bugs.webkit.org/show_bug.cgi?id=79036

We managed to workaround the deadlock by moving some code to make sure the GSocket is created before the proxy resolver is started.
Comment 1 Dan Winship 2012-02-21 13:42:26 UTC
already filed this yesterday

*** This bug has been marked as a duplicate of bug 670479 ***