Hi Team,

We are working on migration of nsldap C sdk to OpenLDAP C sdk for our
application client code.

We are using OpenLDAP 2.6.7.

As part of this migration activity,we used ldap_initialize() API for
initializing and getting LDAP Handle. Our application supports multi
threading. So, ldap_initialize() API will be called from multi threaded
code. For example, 2 threads will call ldap_initialize() at same
time/simultaneously.

When 2 threads call ldap_initialize() at same time, sometimes observed a
race condition during this API call. Due to this, the next api calls
ldap_simple_bind_s or ldap_start_tls_s are getting failed for 2 threads and
it is not recovered automatically until restarts our applications. We
observed this race condition multiple times.

Because of this issue, we are unable to start our application and it
becomes a blocker for us to proceed further.

After checking ldap_initialze() API code from openldap source code, noticed
that race condition happened while initializing/setting global options.

Are there any known issues with OpenLDAP when we use it in multi thread
supported applications?

Could you please check and provide a solution.

Thank you for your help.

Reply via email to