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

RE: ldap_result() fails on large results



> This sounds like ITS#2490.

My opinion too.

> This may be rather difficult to 
> track down since it appears to be timing related, and also 
> depending on the CPU speeds.

Hmm, as far as I saw, ber_get_next() sees, that there should be more
data as the buffer has space for.
Let me put a part of the ITS#2490 here:

> I guess the "while ((rc = ldap_result(..) > 0)" loop ends prematurely
because the
> processing of the results is faster than the delivery of new results.

Applied to this, ldap_result() should "only" be able to wait until more
results get delivered.

> If you've gotten this 
> far, you might try putting some breakpoints in there and also 
> look at the error code in errno when it's about to return 
> LBER_DEFAULT. Set a breakpoint at each of the return 
> statements so you can see what's really making it return the 
> error. Or examine the pointers in the ber structure and see 
> where they're pointing, if that's really the problem.

Already done, that's why I know, that ber_get_next() returns with
LBER_DEFAULT because the buffer pointer is pointing behind the buffer
end. One more evidence not all results have been delivered yet and "we"
should wait for more results instead returning with an error.

Is it right, as I saw so far, that there is no mechanism at all actualy
to detect if not all results have been delivered yet and to wait until
they are?

Patrick

> 
>   -- Howard Chu
>   Chief Architect, Symas Corp.       Director, Highland Sun
>   http://www.symas.com               http://highlandsun.com/hyc
>   Symas: Premier OpenSource Development and Support 
> 
> > -----Original Message-----
> > From: owner-openldap-software@OpenLDAP.org
> > [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Patrick 
> > Dreyer, SY-UCP
> 
> > Hi
> > 
> > I'm doing a search with ldap_search_ext() which returns 
> 1000 results. 
> > The problem is, that ldap_result() fails during processing 
> the results 
> > and returns with -1 and zero for the LDAPMessage.
> 
> > ber_get_next() returns with LBER_DEFAULT.
> > 
> > ber_get_next() (io.c v 1.70.2.10)
> > ==============
> > Line 641:
> >   if ((ber->ber_rwptr>=ber->ber_buf) &&
> > (ber->ber_rwptr<ber->ber_end)) {
> > 
> > ber->ber_rwptr is not between ber->ber_buf and ber->ber_end 
> and so the
> > line 680
> > 
> >   assert( 0 ); /* ber structure is messed up ?*/
> >   return LBER_DEFAULT;
> > 
> > is reached.
>