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

deadlock of slapd on Sun MP machine (ITS#704)

Full_Name: Karsten Künne
Version: 2.0.0
OS: Solaris 7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

I tried to install OpenLDAP 2.0.0 on a Sun E220R (2x450 MHz UltraSPARC) but the
"make test" was always hanging at random tests and at random points inside the
After instrumenting connections.c with a lot of "Debug" macros around all calls
ldap_pvt_thread_mutex_lock and ldap_pvt_thread_mutex_unlock I nailed it down.
what happens:

first thread: - calls connection_read
              - connection_read locks connections_mutex
              - calls connection_get
              - connection_get tries to get lock on c_mutex of the connection

second thread: - calls connection_operation (operation is unbind)
               - connection_operation locks c_mutex of connection
               - connection_operation calls connection_closing
               - connection_operation calls connection_resched
               - connection_resched tries to get lock on connections_mutex

          ======  DEADLOCK =====

The first thread holds the connections_mutex and waits for the c_mutex, the
thread holds the c_mutex and waits for the connections_mutex. It'll probabely
happen on MP machines and also not always. For me it happened more or less
I have no solution yet but I'll try to find a way out.