Hi All,

  I am facing a peculiar problem.
When the DS is in hang state, my LDAP Client hangs up on the
ldap_simple_bind() call:
Here is what I am doing:

  1) ldapssl_client_init
  2) ldapssl_init
  3) ldap_set_option( ld, LDAP_X_OPT_CONNECT_TIMEOUT, &uiTimeLimit1 );
  4) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON );
  5) ldap_set_option( ld, LDAP_OPT_SIZELIMIT, &uiSizeLimit );
  6) ldap_set_option( ld, LDAP_OPT_TIMELIMIT, &timelimit2 );
  7) prldap_set_session_option( ld, NULL, PRLDAP_OPT_IO_MAX_TIMEOUT, tmout
); // tmout set to 5000
  8) ldap_set_option( ld, LDAP_OPT_THREAD_FN_PTRS, (void *) &tfns );
  9) ldap_set_option( ld, LDAP_OPT_EXTRA_THREAD_FN_PTRS, (void *) &extrafns
);
10) ldap_simple_bind

I see that all the steps from 1-9 are successful. However, still the program
hangs up on step 10.
This happens only when the DS is in hang state.

One more thing I noticed is that when I omit step 8 i.e.
LDAP_OPT_THREAD_FN_PTRS, I see it working
properly i.e. ldap_simple_bind returns after 5 seconds.

We cannot ignore this step because we have a multi threaded application that
might have multiple threads
using the same LDAP handle.

When used I also see that the functions used for "ltf_get_errno" &
"ltf_set_errno" are being invoked repeatedly
& in the "ltf_get_errno" the value of erno is 11, which maps to
"Administrative limit exceeded".

The stack traces for the 2 functions are as below:
for set_errno:
#0  set_errno (err=0) at Mozilla_LDAP_Client.cpp:62
#1  0x005f0f03 in nsldapi_send_ber_message () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#2  0x005f1d4b in nsldapi_send_server_request () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#3  0x005f21fb in nsldapi_send_initial_request () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#4  0x005f5931 in simple_bind_nolock () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#5  0x0804943d in main (argc=1, argv=0xbfebda04) at
Mozilla_LDAP_Client.cpp:219

for get_errno:
#0  get_errno () at Mozilla_LDAP_Client.cpp:53
#1  0x005f0f2a in nsldapi_send_ber_message () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#2  0x005f1d4b in nsldapi_send_server_request () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#3  0x005f21fb in nsldapi_send_initial_request () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#4  0x005f5931 in simple_bind_nolock () from
/home/oracle/Denish/ldapcsdk-5.1.7/lib/libldap50.so
#5  0x0804943d in main (argc=1, argv=0xbfebda04) at
Mozilla_LDAP_Client.cpp:219

It seems that somwhere there is an infinite loop going on that is causing
the ldap_simple_bind to hang.

Would appreciate any inputs on this problem

Thanks,
Denish
_______________________________________________
dev-tech-ldap mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-ldap

Reply via email to