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 692278 - LDAP backend mutex deadlock on finalize
LDAP backend mutex deadlock on finalize
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.6.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2013-01-22 11:17 UTC by Tomas Bzatek
Modified: 2013-01-22 19:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Evolution backtrace (18.86 KB, text/plain)
2013-01-22 11:17 UTC, Tomas Bzatek
  Details
e-d-s backtrace (7.51 KB, text/plain)
2013-01-22 11:17 UTC, Tomas Bzatek
  Details
eds patch (4.28 KB, patch)
2013-01-22 19:41 UTC, Milan Crha
committed Details | Review

Description Tomas Bzatek 2013-01-22 11:17:13 UTC
Created attachment 234093 [details]
Evolution backtrace

3.6.2

Using corporate LDAP server as an address book and trying to reply to a mail within corporate IMAP(x) account. Pressing the Reply button makes whole Evolution frozen for significant amount of time while waiting for a Composer window to open.
Comment 1 Tomas Bzatek 2013-01-22 11:17:32 UTC
Created attachment 234094 [details]
e-d-s backtrace
Comment 2 Matthew Barnes 2013-01-22 14:30:46 UTC
Known issue.  See the Evolution backtrace, Thread 1.

I'll be deprecating e_book_client_new() soon for blocking like this.
Comment 3 Milan Crha 2013-01-22 16:32:40 UTC
It's not it. The reason is that the factory is stuck due to LDAP backend waiting for a lock. This DBus call takes only milliseconds, and is basically unavoidable, especially if you want to use the EBookClient instance immediately after the e_book_client_new() call.

A better general fix is to avoid backends doing anything on the factory's main thread, thus add some EBackend functions for timeout/idle/thread invoking, which will run anything scheduled in a dedicated thread, rather than the main thread, which is used by DBus.

Nonetheless, the issue is with LDAP itself here, I'm checking what happened.
Comment 4 Matthew Barnes 2013-01-22 16:53:01 UTC
Both issues need fixed.  The UI blocking is the more egregious.
Comment 5 Milan Crha 2013-01-22 19:41:07 UTC
Created attachment 234132 [details] [review]
eds patch

for evolution-data-server; (gnome-3-6)

This should make it, the LDAP deadlocked on mutexes. One thread holds the op_hash_mutex, while another (the main thread) holds eds_ldap_handler_lock. The main thread asks for the op_hash_mutex, and the other thread asks for the eds_ldap_handler_lock, thus no luck for both.

This fix just locks the eds_ldap_handler_lock before any use of op_hash_mutex, to avoid the deadlock.
Comment 6 Milan Crha 2013-01-22 19:41:41 UTC
Relevant part of the eds backtrace (for easier searching):

Thread 1 (Thread 0x7fedd04a9740 (LWP 28087))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 135
  • #1 _L_lock_1046
    from /lib64/libpthread.so.0
  • #2 __GI___pthread_mutex_lock
    at pthread_mutex_lock.c line 85
  • #3 g_static_rec_mutex_lock
    at deprecated/gthread-deprecated.c line 715
  • #4 poll_ldap
    at e-book-backend-ldap.c line 4771
  • #5 poll_ldap
    at e-book-backend-ldap.c line 4720
  • #6 g_timeout_dispatch
    at gmain.c line 4095
  • #7 g_main_dispatch
    at gmain.c line 2784
  • #8 g_main_context_dispatch
    at gmain.c line 3288
  • #9 g_main_context_iterate
    at gmain.c line 3359
  • #10 g_main_loop_run
    at gmain.c line 3553
  • #11 dbus_server_run_server
    at e-dbus-server.c line 222
  • #12 ffi_call_unix64
    at ../src/x86/unix64.S line 75
  • #13 ffi_call
    at ../src/x86/ffi64.c line 492
  • #14 g_cclosure_marshal_generic_va
  • #15 _g_closure_invoke_va
    at gclosure.c line 840
  • #16 g_signal_emit_valist
    at gsignal.c line 3226
  • #17 g_signal_emit
    at gsignal.c line 3371
  • #18 e_dbus_server_run
    at e-dbus-server.c line 396
  • #19 main
    at evolution-addressbook-factory.c line 129

Comment 7 Milan Crha 2013-01-22 19:45:49 UTC
Created commit 98d297d in eds master (3.7.5+)
Created commit a84d026 in eds gnome-3-6 (3.6.4+)