Raymond Toy <toy(a)rtp.ericsson.se>, on Wed, 15 Jan 2003 at 12:05:00 -0500
(EST) you wrote:
Any use of ldap crashes xemacs for me. I'm using openldap
2.1.12
(Should probably use the Sun ldap libraries, but that's a different
issue.)
Well I have good news and bad news. The good news is that it works fine
for me on Linux. The bad news is that it works fine for me on Linux.
That means that I have to hunt up a Sun machine to try to reproduce your
situation. Your crash is weird, though. Check this out.
There's also this error message:
Assertion failed: LBER_VALID( ber ), file sasl.c, line 99
Here's the context, a piece of function ldap_sasl_bind:
/* create a message to send */
if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
ld->ld_errno = LDAP_NO_MEMORY;
return ld->ld_errno;
}
assert( LBER_VALID( ber ) );
The LBER_VALID macro is defined in liblber/lber-int.h as follows:
#define LBER_VALID(ber) ((ber)->ber_valid==LBER_VALID_BERELEMENT)
ldap_alloc_ber_with_options is defined in request.c. It is a thin
wrapper around this:
ber_alloc_t( ld->ld_lberoptions ))
The wrapper just checks for memory allocation failures. Now ber_alloc_t
is defined in liblber/io.c:
BerElement *
ber_alloc_t( int options )
{
BerElement *ber;
ber_int_options.lbo_valid = LBER_INITIALIZED;
ber = (BerElement *) LBER_CALLOC( 1, sizeof(BerElement) );
if ( ber == NULL ) {
return NULL;
}
ber->ber_valid = LBER_VALID_BERELEMENT;
ber->ber_tag = LBER_DEFAULT;
ber->ber_options = options;
ber->ber_debug = ber_int_debug;
assert( LBER_VALID( ber ) );
return ber;
}
In short, the same assertion succeeded in ber_alloc_t just before it
failed in ldap_sasl_bind, and the contents of the BerElement were not
touched in between. So this isn't the real failure. Whatever is really
causing the problem isn't getting tickled on my Linux machine.
Are your LDAP libraries built with debug symbols? If so, could you try
the following?
(1) Set a breakpoint on ldap_sasl_bind.
(2) When you hit the breakpoint, step down into ber_alloc_t, and step to
the assert.
(3) Set a watchpoint on ber.
(4) Continue.
Watch, the problem won't happen while running under debugger control...
--
Jerry James, who notes the OpenLDAP developers must be using 4-space tabs
http://www.ittc.ku.edu/~james/