Crashes in ldap_unbind

Pradnyesh <[email protected]>
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Hi All,

We have a multi-threaded server that uses netscape ldap c sdk 4.1 in
it's older release. We are experiencing some random crashes, while
freeing memory, in the call to ldap_unbind() in our code. Due to its
random nature, We haven't been able to create a test case for the
issue so far. 

Our environment is as follows

- The backend directory server is AD.NET 2003 and our server is
running on a Win 2003 box. AD.NET is by default configured to close
idle ldap connections every 15 mins.
- ldap sdk version is 4.1. [We have alread migrated to ldap sdk 5.X in
the later versions of our product.]
- Another thing that is hampering us is that there are no Windows
symbol files[pdb] available for ldap sdk 4.1, which prevents us from
capturing an exact stacktrace inside ldap_unbind.
- Our server creates a pool of ldap connections with separate
dedicated threads to create new connections as well as clean-up old
connections.
- multiple worker threads can share the same ldap connection handle at
the same time. e.g. you can have multiple ldap_simple_bind going
asynchronously over the same ldap connection handle at the same time.
- we have registered callback functions for createmutex, lockmutex,
unlockmutex, freemutex, getthreadid, getldaperror etc.
- we have confirmed via logging that we are not calling ldap_unbind
twice on the same ldap handle.

Please let me know if anyone has any suggestions. 

I also noticed that there were already a couple of posts regarding
crashes in ldap_unbind. Did we have any resolutions for these?

Heroux, Bernard R wrote on 3/30/2006
> Every so often the ldap_unbind_s will cause a crash.  This occurs even 
> when checking the ldapHandle for NULL before calling the unbind.

Mike wrote on 3/2/2006
> I was reading through the documentation on how to handle failover or 
> being disconnected from an LDAP server in my apps.  One method is to 
> call ldap_unbind and reconnect and rebind, while the other method is set 
> the LDAP_OPT_RECONNECT option and only rebind (i.e. don't call 
> ldap_unbind).
>
> http://www.mozilla.org/directory/csdk-docs/using.htm#handle_failover
>
> We had been using the former of the two methods, but some of our apps 
> were coring randomly during the ldap_unbind call

Thanks & Regards,
Pradnyesh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.