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 697128 - deadlock in g_dbus_connection_get_type()
deadlock in g_dbus_connection_get_type()
Status: RESOLVED DUPLICATE of bug 674885
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-04-02 17:48 UTC by Xavier Claessens
Modified: 2013-04-02 17:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Xavier Claessens 2013-04-02 17:48:49 UTC
I'm writing an app that uses gdbus-codegen. When I create the proxy sometimes it deadlock. I attached gdb and 2 threads are stuck in g_dbus_connection_get_type():

Thread 4 (Thread 0x7f99bf27e700 (LWP 18546))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 135
  • #1 _L_lock_1035
    from /lib/x86_64-linux-gnu/libpthread.so.0
  • #2 __GI___pthread_mutex_lock
    at pthread_mutex_lock.c line 85
  • #3 g_type_add_interface_static
    at /build/buildd/glib2.0-2.36.0/./gobject/gtype.c line 2849
  • #4 g_dbus_connection_get_type
    at /build/buildd/glib2.0-2.36.0/./gio/gdbusconnection.c line 523
  • #5 get_uninitialized_connection
    at /build/buildd/glib2.0-2.36.0/./gio/gdbusconnection.c line 6805
  • #6 g_bus_get_sync
    at /build/buildd/glib2.0-2.36.0/./gio/gdbusconnection.c line 6878
  • #7 ??
    from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
  • #8 ??
    from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
  • #9 g_main_dispatch
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c line 3054
  • #10 g_main_context_dispatch
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c line 3630
  • #11 g_main_context_iterate
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c line 3701
  • #12 g_main_context_iteration
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c line 3762
  • #13 ??
    from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
  • #14 g_thread_proxy
    at /build/buildd/glib2.0-2.36.0/./glib/gthread.c line 798
  • #15 start_thread
    at pthread_create.c line 311
  • #16 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 113

Comment 1 Xavier Claessens 2013-04-02 17:49:44 UTC
Hm, don't trust bugzilla for the backtrace, it shows only the first thread. Click on "Trace 231713" to get everything.
Comment 2 Xavier Claessens 2013-04-02 17:52:56 UTC
Looks like dconfsettings is creating a thread that does g_bus_get_sync() at the very same time than my main thread that creates the proxy, so both goes into g_dbus_connection_get_type() at the same time, and something goes wrong.

Note that my app does not use any thread by itself. And this is with glib 2.36.0
Comment 3 Allison Karlitskaya (desrt) 2013-04-02 17:59:35 UTC

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