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

openldap 2.2.18 monitor backend and pthread



I think I've hit a bug in the monitor backend pthread code. Sadly I 
know very little about pthreads but hopefully this will be informative to someone...


NetBSD's pthread implementation by default checks for mutex erreors in client
applications, and kills a process if it detects one. When I enable the monitor
backend on openldap 2.2.18, the kernel kills off slapd midsearch... searches
elsewhere in the DIT are fine, so I'm pretty sure this is slapd-monitor.

a quick gdb bt looks like the problem is in ldap_pvt_thread_mutex_unlock()
(I expect you need more information than below to track this down, bu t I don't 
want to spam the lits with pages of guff, so mail me if you need more info).


----------------------------------------------------------------------------

rasputin@lb:rasputin$ ldapsearch -b cn=monitor
# extended LDIF
#
# LDAPv3
# base <cn=monitor> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# Monitor
dn: cn=Monitor
objectClass: monitorServer
cn: Monitor
description: This subtree contains monitoring/managing objects.
description: This object contains information about this server.

# Overlay, Monitor
dn: cn=Overlay,cn=Monitor
objectClass: monitorContainer
cn: Overlay
ldap_result: Can't contact LDAP server (-1)

----------------------------------------------------------------------------

slapd -d1 output :


----------------------------------------------------------------------------
<= send_search_entry
=> send_search_entry: dn="cn=Overlay,cn=Monitor"
ber_flush: 84 bytes to sd 9
<= send_search_entry
slapd: Error detected by libpthread: Unlocking unlocked mutex.
Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 345, function "pthread_mutex_unlock".
See pthread(3) for information.
Abort trap (core dumped)
----------------------------------------------------------------------------

gdb backtrace:

----------------------------------------------------------------------------
Loaded symbols for /usr/lib/libcrypto.so.2
Reading symbols from /usr/lib/libwrap.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libwrap.so.0
Reading symbols from /usr/lib/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpthread.so.0
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
#0  0x483962bb in kill () from /usr/lib/libc.so.12
(gdb) bt
#0  0x483962bb in kill () from /usr/lib/libc.so.12
#1  0x48375875 in pthread__errorfunc () from /usr/lib/libpthread.so.0
#2  0x48372b9b in pthread_mutex_unlock () from /usr/lib/libpthread.so.0
#3  0x48140d8c in ldap_pvt_thread_mutex_unlock () from /usr/pkg/lib/libldap_r-2.2.so.7
#4  0x080e6329 in ldap_str2matchingrule ()
#5  0x080ba44f in ldap_str2matchingrule ()
#6  0x080ba4f2 in ldap_str2matchingrule ()
#7  0x080ba6b7 in ldap_str2matchingrule ()
#8  0x0805bd77 in ldap_str2matchingrule ()
#9  0x0805a66f in ldap_str2matchingrule ()
#10 0x481403c7 in ldap_int_thread_pool_wrapper () from /usr/pkg/lib/libldap_r-2.2.so.7
#11 0x483747a9 in pthread_create () from /usr/lib/libpthread.so.0

-- 
If we can hit that bull's-eye, the rest of the dominoes will fall like a
house of cards... Checkmate! - Zapp. Brannigan
Rasputin :: Jack of All Trades - Master of Nuns