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

RE: failed assertion `LBER_VALID( ber )'



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Patrick H Radtke

> Hi,
>
> I'm having a strange problem with OpenLDAP 2.1.23.
>
> I am programming in c and when I try to bind I get the following error
>
> ../../../../src/libraries/libldap/sasl.c:99: failed assertion
> `LBER_VALID( ber )'
> Abort (core dumped)
>
> Here is the code I am running
> #include <lber.h>  // for ldap
> #include <ldap.h>
> #include <string>
>
> int main(int argc, char * argv[])
> {
> LDAP * ld;
> int msgid;
> ld = ldap_init("manheru",2002);
>
> if (ld==NULL)
> {
>     cout << "error in init." << endl;
>     ldap_perror(ld, "bad init:");
> }
>
> //this line is the problem
> int errorCode = ldap_simple_bind_s(ld,"name","password");
>
> cout << ldap_err2string(errorCode) << endl;
> ldap_unbind(ld);
>
> }
>
> The crash occurs when I use ldap_bind as well, and with both
> synchronous
> and ansynchrnous binding.
> It also doesn't matter what I pass for name and password. It crashes
> regardless.
>
> ldapsearch, ldapadd etc work fine even though they call the
> same functions.
>
> I was also able to bind with the java LDAP library.
>
> We are running it on a sun machine
> info: SunOS manheru 5.9 Generic_112233-07 sun4u sparc
> SUNW,Ultra-80 Solaris
>
> For compiling I'm using g++
>
> any help, or suggestions will be greatly appreciated.

This occurs on Solaris systems because you're mixing the OpenLDAP code with
the Sun bundled LDAP libraries. Fix your build environment so that it only
uses one set of header and library files.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support