[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5814) concurrent access to connections



Pierangelo Masarati writes:
> Do you see a thread waiting on 
> ldap_pvt_thread_mutex_lock( &connections_mutex ); at connection.c:427 or 
> connection.c:514?

Yes, thread 4:
(gdb) thread apply all backtrace

Thread 10 (process 8228):
#0  0x00000038cf6075b5 in pthread_join () from /lib64/libpthread.so.0
#1  0x000000000042afa2 in slapd_daemon () at daemon.c:2656
#2  0x00000000004198c4 in main (argc=8, argv=0x7fff65271058) at main.c:948

Thread 9 (process 8245):
#0  0x00000038cead1f58 in epoll_wait () from /lib64/libc.so.6
#1  0x000000000042d2bb in slapd_daemon_task (ptr=<value optimized out>) at daemon.c:2291
#2  0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#3  0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 8 (process 8260):
#0  0x00000038ceab8947 in sched_yield () from /lib64/libc.so.6
#1  0x00002acc4bb99bd0 in meta_back_search (op=0x14f7c4b0, rs=0x42f23ca0) at search.c:1542
#2  0x0000000000432276 in fe_op_search (op=0x14f7c4b0, rs=0x42f23ca0) at search.c:366
#3  0x0000000000432a07 in do_search (op=0x14f7c4b0, rs=0x42f23ca0) at search.c:217
#4  0x0000000000430331 in connection_operation (ctx=0x42f23df0, arg_v=<value optimized out>) at connection.c:1090
#5  0x000000000043077d in connection_read_thread (ctx=0x42f23df0, argv=<value optimized out>) at connection.c:1216
#6  0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#7  0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#8  0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 7 (process 8261):
#0  0x00000038ceac9016 in poll () from /lib64/libc.so.6
#1  0x00002acc4584d142 in ldap_result (ld=0x15815910, msgid=346, all=1, timeout=<value optimized out>, result=0x437249e8) at result.c:355
#2  0x00002acc4bb9afa8 in meta_back_op_result (mc=0x15815810, op=0x1507ca40, rs=0x43724ca0, candidate=1, msgid=346, timeout=0, sendok=LDAP_BACK_SENDRESULT)
    at bind.c:1004
#3  0x00002acc4bb9e731 in meta_back_modrdn (op=0x1507ca40, rs=0x43724ca0) at modrdn.c:141
#4  0x000000000044874a in fe_op_modrdn (op=0x1507ca40, rs=0x43724ca0) at modrdn.c:314
#5  0x00000000004491b4 in do_modrdn (op=0x1507ca40, rs=0x43724ca0) at modrdn.c:186
#6  0x0000000000430331 in connection_operation (ctx=0x43724df0, arg_v=<value optimized out>) at connection.c:1090
#7  0x000000000043077d in connection_read_thread (ctx=0x43724df0, argv=<value optimized out>) at connection.c:1216
#8  0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#9  0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#10 0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 6 (process 8391):
#0  0x00000038ceac9016 in poll () from /lib64/libc.so.6
#1  0x00002acc4584d142 in ldap_result (ld=0x1519d440, msgid=87, all=2, timeout=<value optimized out>, result=0x41b015f0) at result.c:355
#2  0x00002acc4bb9773c in meta_back_search (op=0x41b01640, rs=0x41b017b0) at search.c:1027
#3  0x00002acc4bba07a3 in meta_back_get_candidate (op=0x151c0b70, rs=0x41b01ca0, ndn=0x41b019a0) at conn.c:891
#4  0x00002acc4bba26fa in meta_back_getconn (op=0x151c0b70, rs=0x41b01ca0, candidate=0x0, sendok=LDAP_BACK_BINDING) at conn.c:1325
#5  0x00002acc4bb9c4cb in meta_back_bind (op=0x151c0b70, rs=0x41b01ca0) at bind.c:96
#6  0x000000000044b52e in fe_op_bind (op=0x151c0b70, rs=0x41b01ca0) at bind.c:383
#7  0x000000000044bf2f in do_bind (op=0x151c0b70, rs=0x41b01ca0) at bind.c:205
#8  0x0000000000430331 in connection_operation (ctx=0x41b01df0, arg_v=<value optimized out>) at connection.c:1090
#9  0x000000000043077d in connection_read_thread (ctx=0x41b01df0, argv=<value optimized out>) at connection.c:1216
#10 0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#11 0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#12 0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 5 (process 8392):
#0  0x00000038cf60c888 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
#1  0x00000038cf6088a5 in _L_mutex_lock_107 () from /lib64/libpthread.so.0
#2  0x00000038cf608333 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x00002acc4bdb2b57 in monitor_cache_lock (e=<value optimized out>) at cache.c:117
#4  0x00002acc4bdb1f9f in monitor_send_children (op=0x152cf4f0, rs=0x43f25ca0, e_parent=<value optimized out>, sub=1) at search.c:144
#5  0x00002acc4bdb2017 in monitor_send_children (op=0x152cf4f0, rs=0x43f25ca0, e_parent=<value optimized out>, sub=1) at search.c:123
#6  0x00002acc4bdb23a7 in monitor_back_search (op=0x152cf4f0, rs=0x43f25ca0) at search.c:245
#7  0x0000000000432276 in fe_op_search (op=0x152cf4f0, rs=0x43f25ca0) at search.c:366
#8  0x0000000000432a07 in do_search (op=0x152cf4f0, rs=0x43f25ca0) at search.c:217
#9  0x0000000000430331 in connection_operation (ctx=0x43f25df0, arg_v=<value optimized out>) at connection.c:1090
#10 0x000000000043077d in connection_read_thread (ctx=0x43f25df0, argv=<value optimized out>) at connection.c:1216
#11 0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#12 0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#13 0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 4 (process 8393):
#0  0x00000038cf60c888 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
#1  0x00000038cf6088a5 in _L_mutex_lock_107 () from /lib64/libpthread.so.0
#2  0x00000038cf608333 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000000000431775 in connection_init (s=31, listener=0x14e3b280, dnsname=0x4c39b5 "unknown", peername=0x447258a0 "IP=127.0.0.1:50895", flags=0, ssf=0, 
    authid=0x0) at connection.c:514
#4  0x000000000042b40a in slap_listener_thread (ctx=<value optimized out>, ptr=<value optimized out>) at daemon.c:1965
#5  0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#6  0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#7  0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 3 (process 8395):
#0  0x00000038ceac9016 in poll () from /lib64/libc.so.6
#1  0x00002acc4584d142 in ldap_result (ld=0x152cda90, msgid=529, all=2, timeout=<value optimized out>, result=0x44f275f0) at result.c:355
#2  0x00002acc4bb9773c in meta_back_search (op=0x44f27640, rs=0x44f277b0) at search.c:1027
#3  0x00002acc4bba07a3 in meta_back_get_candidate (op=0x154d8a90, rs=0x44f27ca0, ndn=0x44f279a0) at conn.c:891
#4  0x00002acc4bba26fa in meta_back_getconn (op=0x154d8a90, rs=0x44f27ca0, candidate=0x0, sendok=LDAP_BACK_BINDING) at conn.c:1325
#5  0x00002acc4bb9c4cb in meta_back_bind (op=0x154d8a90, rs=0x44f27ca0) at bind.c:96
#6  0x000000000044b52e in fe_op_bind (op=0x154d8a90, rs=0x44f27ca0) at bind.c:383
#7  0x000000000044bf2f in do_bind (op=0x154d8a90, rs=0x44f27ca0) at bind.c:205
#8  0x0000000000430331 in connection_operation (ctx=0x44f27df0, arg_v=<value optimized out>) at connection.c:1090
#9  0x000000000043077d in connection_read_thread (ctx=0x44f27df0, argv=<value optimized out>) at connection.c:1216
#10 0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#11 0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#12 0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 2 (process 8497):
#0  0x00000038cf60a496 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00002acc4584a1f8 in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:654
#2  0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#3  0x00000038cead1b6d in clone () from /lib64/libc.so.6

Thread 1 (process 8498):
#0  0x00000038cea30155 in raise () from /lib64/libc.so.6
#1  0x00000038cea31bf0 in abort () from /lib64/libc.so.6
#2  0x00000038cea295d6 in __assert_fail () from /lib64/libc.so.6
#3  0x0000000000431122 in connection_next (c=0x2acc4bfcad90, index=0x45f28a7c) at connection.c:877
#4  0x00002acc4bdb774f in monitor_subsys_conn_update (op=<value optimized out>, rs=<value optimized out>, e=0x14f10c88) at conn.c:230
#5  0x00002acc4bdb39cb in monitor_entry_update (op=0x2024, rs=0x45f29ca0, e=0x6) at entry.c:59
#6  0x00002acc4bdb1fd0 in monitor_send_children (op=0x15714210, rs=0x45f29ca0, e_parent=0x14f10c88, sub=1) at search.c:88
#7  0x00002acc4bdb2017 in monitor_send_children (op=0x15714210, rs=0x45f29ca0, e_parent=<value optimized out>, sub=1) at search.c:123
#8  0x00002acc4bdb23a7 in monitor_back_search (op=0x15714210, rs=0x45f29ca0) at search.c:245
#9  0x0000000000432276 in fe_op_search (op=0x15714210, rs=0x45f29ca0) at search.c:366
#10 0x0000000000432a07 in do_search (op=0x15714210, rs=0x45f29ca0) at search.c:217
#11 0x0000000000430331 in connection_operation (ctx=0x45f29df0, arg_v=<value optimized out>) at connection.c:1090
#12 0x000000000043077d in connection_read_thread (ctx=0x45f29df0, argv=<value optimized out>) at connection.c:1216
#13 0x00002acc4584a1aa in ldap_int_thread_pool_wrapper (xpool=0x14e6bce0) at tpool.c:663
#14 0x00000038cf6062f7 in start_thread () from /lib64/libpthread.so.0
#15 0x00000038cead1b6d in clone () from /lib64/libc.so.6

(gdb) thread 4
(gdb) frame 3
#3  0x0000000000431775 in connection_init (s=31, listener=0x14e3b280, dnsname=0x4c39b5 "unknown", peername=0x447258a0 "IP=127.0.0.1:50895", flags=0, ssf=0, 
    authid=0x0) at connection.c:514
514             ldap_pvt_thread_mutex_lock( &connections_mutex );
(gdb) p c
$4 = (Connection *) 0x2acc4bfcad90
(gdb) p *c
$5 = {c_struct_state = 1, c_conn_state = 1, c_conn_idx = 31, c_sd = 31, c_close_reason = 0x4c355a "?", c_mutex = {__data = {__lock = 1, __count = 0, 
      __owner = 8393, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
    __size = "\001\000\000\000\000\000\000\000É \000\000\001", '\0' <repeats 26 times>, __align = 1}, c_sb = 0x2aaab0009680, c_starttime = 1226874133, 
  c_activitytime = 1226874133, c_connid = 46, c_peer_domain = {bv_len = 7, bv_val = 0x14f72e90 "unknown"}, c_peer_name = {bv_len = 18, 
    bv_val = 0x1581ecc0 "IP=127.0.0.1:50895"}, c_listener = 0x14e3b280, c_sasl_bind_mech = {bv_len = 0, bv_val = 0x0}, c_sasl_dn = {bv_len = 0, bv_val = 0x0}, 
  c_sasl_authz_dn = {bv_len = 0, bv_val = 0x0}, c_authz_backend = 0x0, c_authz_cookie = 0x0, c_authz = {sai_method = 128, sai_mech = {bv_len = 0, bv_val = 0x0}, 
    sai_dn = {bv_len = 0, bv_val = 0x0}, sai_ndn = {bv_len = 0, bv_val = 0x0}, sai_ssf = 0, sai_transport_ssf = 0, sai_tls_ssf = 0, sai_sasl_ssf = 0}, 
  c_protocol = 0, c_ops = {stqh_first = 0x0, stqh_last = 0x2acc4bfcaea8}, c_pending_ops = {stqh_first = 0x0, stqh_last = 0x2acc4bfcaeb8}, c_write_mutex = {
    __data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
    __size = '\0' <repeats 39 times>, __align = 0}, c_write_cv = {__data = {__lock = 0, __futex = 2, __total_seq = 1, __wakeup_seq = 1, __woken_seq = 1, 
      __mutex = 0x2acc4bfcada8, __nwaiters = 0, __broadcast_seq = 0}, 
    __size = "\000\000\000\000\002\000\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000¨­üKÌ*\000\000\000\000\000\000\000\000\000", __align = 8589934592}, c_currentber = 0x0, c_sasl_bind_in_progress = 0 '\0', c_writewaiter = 0 '\0', c_is_tls = 0 '\0', 
  c_needs_tls_accept = 0 '\0', c_sasl_layers = 0 '\0', c_sasl_done = 0 '\0', c_sasl_authctx = 0x0, c_sasl_sockctx = 0x0, c_sasl_extra = 0x0, c_sasl_bindop = 0x0, 
  c_txn = 0, c_txn_backend = 0x0, c_txn_ops = {stqh_first = 0x0, stqh_last = 0x2acc4bfcaf60}, c_pagedresults_state = {ps_be = 0x0, ps_size = 0, ps_count = 0, 
    ps_cookie = 0, ps_cookieval = {bv_len = 0, bv_val = 0x0}}, c_n_ops_received = 0, c_n_ops_executing = 0, c_n_ops_pending = 0, c_n_ops_completed = 0, 
  c_n_get = 0, c_n_read = 0, c_n_write = 0, c_extensions = 0x0, c_clientfunc = 0, c_clientarg = 0x0, c_send_ldap_result = 0x441cb0 <slap_send_ldap_result>, 
  c_send_search_entry = 0x43f700 <slap_send_search_entry>, c_send_search_reference = 0x43f050 <slap_send_search_reference>, 
  c_send_ldap_extended = 0x441810 <slap_send_ldap_extended>, c_send_ldap_intermediate = 0x4416c0 <slap_send_ldap_intermediate>}

-- 
Hallvard