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

Memory and Handle Leak using bdb and paged result do not work with ldbm (ITS#3356)

Full_Name: Stefan Eckbauer
Version: 2.2.17
OS: Windows XP
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

I am using openldap 2.2.17,
Sleepycat Berkley DB 4.2.52 with patches
regex 2.3.2
openssl 0.9.7d
compiled with mingw on win32 (using the sample build scripts from Lucas

Eyery ldap_add causes a handle and memory leak.
When adding entries (using ldap_add programmatically and not slapadd) the handle
count increases very fast, the memory consumption as well. The handles never get

The handles that are never closed are mutants, seems as if a mutex is not
closed. (If you do not know what a mutant is see Microkernel Objects in

The problem does not occur when using ldbm, it only occurs when using bdb.
I had a look at the thr_nt.c and it seems as if the ldap_pv_thread_mutex_init
and _destroy functions are correct. I think it happens in the DB lib.
I think it will happen on other platforms as well.

I am not able to debug the problem, I would need some colorful window
(Devstudio) for that.

There is a second problem that came up when I decided to use ldbm instead of bdb
(because of the handle and memory leak):
The paged search results do not work when using ldbm.

If you need details, please tell me what you need.

Best regards,