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

Re: ldap_int_global_options not initialized (ITS#5109)

damien.doiselet@neolane.com wrote:

> My application is multithread.


> I've had a call to ldap_get_option(NULL, LDAP_OPT_API_INFO, &ldapi) 
> before spawning threads, but here the crash occurred also in 
> ldap_initailize but in ldap_ld_free().

The above sentence is not clear to me; what does the trace below refer
to?  Your original application, or the one that calls ldap_get_option
before spawning threads?  What does ldap_ld_free() have to do with this?
 It never occurs in the trace below.

> I addition, I won't call ldap outside my thread.

Doesn't matter.  Global options are global, so multiple threads may find
it uninit'ed, and try to concurrently initialize it.

> The full stack trace is :
> #0  0xb7e93473 in strlen () from /lib/tls/i686/cmov/libc.so.6
> #1  0xb3a191f9 in ber_strdup_x (s=0x6a626f28 <Address 0x6a626f28 out of 
> bounds>, ctx=0x0)    at memory.c:640
> #2  0xadd2fd66 in ldap_charray_dup (a=0xb313a324) at charray.c:164
> #3  0xadd26883 in ldap_url_dup (ludp=0x8b83798) at url.c:1191
> #4  0xadd26912 in ldap_url_duplist (ludlist=0x8b83798) at url.c:1217
> #5  0xadd11b34 in ldap_create (ldp=0xb32e0dc8) at open.c:149
> #6  0xadd11de1 in ldap_initialize (ldp=0xb32e0ec0, url=0x8946d20 
> "ldap://ldap:389";)    at open.c:225

Please make sure you're calling the desired library objects (libldap &
liblber).  Can you post the result of ldd for your application?

> I have same thing with the 2.3.38

Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Email:   pierangelo.masarati@sys-net.it