[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) (131.169.137.215)


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
tests.
After instrumenting connections.c with a lot of "Debug" macros around all calls
to
ldap_pvt_thread_mutex_lock and ldap_pvt_thread_mutex_unlock I nailed it down.
Here's
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
second
thread holds the c_mutex and waits for the connections_mutex. It'll probabely
only
happen on MP machines and also not always. For me it happened more or less
randomly.
I have no solution yet but I'll try to find a way out.