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

failed assertion `LBER_VALID( ber )'


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;


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.