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

malloc errors in ldap_unbind() (ITS#1267)



Full_Name: Scott Atchley
Version: 2.0.11
OS: Linux 2.4`
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (160.36.57.142)


I am using 2.0.11 on RH 7.1. I store about 40K records in openldap. I have
written
another server that queries the ldap server for this information. (We do not
want
our users to query openldap directly).

All seems to be working well until I try to stress the servers. I have written
multi-
threaded client programs that open 3 or 15 simulataneously connections with my
server
which then opens a similar number of connections with slapd. I am getting
random
segfaults when the thread is finished and calls ldap_unbind(). It seems to be
getting
a valid LDAP* pointer.

The stack from gdb looks like:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16401 (LWP 16915)]
0x4011000a in chunk_free (ar_ptr=0x401b8f00, p=0xe7e71208) at malloc.c:3125
3125	malloc.c: No such file or directory.
	in malloc.c
(gdb) where
#0  0x4011000a in chunk_free (ar_ptr=0x401b8f00, p=0xe7e71208) at malloc.c:3125
#1  0x4010fd59 in __libc_free (mem=0x8073230) at malloc.c:3054
#2  0x4008bfdd in ber_memfree () at eval.c:41
#3  0x4006d712 in ldap_ld_free () at eval.c:41
#4  0x4006d4b9 in ldap_unbind_ext () at eval.c:41
#5  0x4006d529 in ldap_unbind () at eval.c:41

The rest of the stack is my code (two levels more). If I go "up" in gdb to the
unbind
call and I enter "p ldap" (ldap is the pointer), it shows:

(gdb) p ldap
$1 = (LDAP *) 0x8073230

Any ideas?

Scott Atchley
scott@utk.edu