--0-1804724661-1266012508=:41453
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

On point to note, i have the same situation as here : http://www.openldap.o=
rg/lists/openldap-technical/200912/msg00007.html

--- On Fri, 2/12/10, alin vasile <[email protected]> wrote:


From: alin vasile <[email protected]>
Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: [email protected]
Cc: [email protected]
Date: Friday, February 12, 2010, 1:56 PM






looping openldap group

--- On Fri, 2/12/10, alin vasile <[email protected]> wrote:


From: alin vasile <[email protected]>
Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: [email protected]
Date: Friday, February 12, 2010, 1:55 PM







Hi Serghei,
=A0
=A0=A0=A0=A0 For the first point, the function ldap_msgfree=A0 will check f=
or NULL, so if the check is missing, no error occurs.
=A0
=A0=A0=A0 I am using the ldap_search_ext_s function (the synchronous one) s=
o the second and third point doesn't apply as i don't have access to the ms=
gid. If the memory leak is high maybe will switch to the async queries.
=A0
Regards,
Alin
=A0
=A0=A0=20
=A0=A0=A0=20

--- On Fri, 2/12/10, [email protected] <[email protected]> wrote:


From: [email protected] <[email protected]>
Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: [email protected]
Cc: [email protected]
Date: Friday, February 12, 2010, 1:34 PM


Buna ziua, domnule.

1. The pointer must be checked before operation, e.g.
if (res !=3D NULL) {
=A0 =A0 ldap_msgfree (res);
=A0 =A0 res =3D NULL;
}

2. Also while processing the ext query, you should call the functions in
the following manner:
2.1 ldap_search_ext() which has pointer to msgid
2.2 ldap_result() which gives the LDAPMessage structure for the msgid
2.3 if ok - ldap_parse_result()
2.4 on any stage if something is not good and you have the msgid filled
with value (integer, typicaly more then 1) you should call
ldap_abandon_ext() for that msgid
2.5 Finish with ldap_msgfree()

3. Periodically between the asynchronous searches (after 100 for
example)you should call ldap_result() with short timer and LDAP_RES_ANY
argue for clearing stalled or nonfreed calls. The obtained LDAPMessage can
be freed with ldap_msgfree(). Of course, you can count the asynch calls
which hadn't been completed or were timed out and you can make the
corresponding cycle for checking all iterations.

Please try and let me know.

With respect, Serghei.



=0A=0A=0A      
--0-1804724661-1266012508=:41453
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">On point to note, i have the same situation a=
s here : <A href=3D"http://www.openldap.org/lists/openldap-technical/200912=
/msg00007.html">http://www.openldap.org/lists/openldap-technical/200912/msg=
00007.html</A><BR><BR>--- On <B>Fri, 2/12/10, alin vasile <I>&lt;alinachega=
[email protected]&gt;</I></B> wrote:<BR>
<BLOCKQUOTE style=3D"BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5=
px; MARGIN-LEFT: 5px"><BR>From: alin vasile &lt;[email protected]&gt=
;<BR>Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT<BR>To: li=
[email protected]<BR>Cc: [email protected]<BR>Date: Friday, February 1=
2, 2010, 1:56 PM<BR><BR>
<DIV id=3Dyiv1659718545>
<TABLE border=3D0 cellSpacing=3D0 cellPadding=3D0>
<TBODY>
<TR>
<TD vAlign=3Dtop>looping openldap group<BR><BR>--- On <B>Fri, 2/12/10, alin=
 vasile <I>&lt;[email protected]&gt;</I></B> wrote:<BR>
<BLOCKQUOTE style=3D"BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5=
px; MARGIN-LEFT: 5px"><BR>From: alin vasile &lt;[email protected]&gt=
;<BR>Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT<BR>To: li=
[email protected]<BR>Date: Friday, February 12, 2010, 1:55 PM<BR><BR>
<DIV id=3Dyiv1668921465>
<TABLE border=3D0 cellSpacing=3D0 cellPadding=3D0>
<TBODY>
<TR>
<TD vAlign=3Dtop>
<DIV>Hi Serghei,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; For the first point, the function ldap_msgfre=
e&nbsp; will check for NULL, so if the check is missing, no error occurs.</=
DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; I am using the ldap_search_ext_s function (the sync=
hronous one) so the second and third point doesn't apply as i don't have ac=
cess to the msgid. If the memory leak is high maybe will switch to the asyn=
c queries.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>Alin</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp; <BR><BR>--- On <B>Fri, 2/12/10, [email protected] <I=
>&lt;[email protected]&gt;</I></B> wrote:<BR></DIV>
<BLOCKQUOTE style=3D"BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5=
px; MARGIN-LEFT: 5px"><BR>From: [email protected] &lt;[email protected]&gt;<B=
R>Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT<BR>To: openl=
[email protected]<BR>Cc: [email protected]<BR>Date: Friday, Febru=
ary 12, 2010, 1:34 PM<BR><BR>
<DIV class=3DplainMail>Buna ziua, domnule.<BR><BR>1. The pointer must be ch=
ecked before operation, e.g.<BR>if (res !=3D NULL) {<BR>&nbsp; &nbsp; ldap_=
msgfree (res);<BR>&nbsp; &nbsp; res =3D NULL;<BR>}<BR><BR>2. Also while pro=
cessing the ext query, you should call the functions in<BR>the following ma=
nner:<BR>2.1 ldap_search_ext() which has pointer to msgid<BR>2.2 ldap_resul=
t() which gives the LDAPMessage structure for the msgid<BR>2.3 if ok - ldap=
_parse_result()<BR>2.4 on any stage if something is not good and you have t=
he msgid filled<BR>with value (integer, typicaly more then 1) you should ca=
ll<BR>ldap_abandon_ext() for that msgid<BR>2.5 Finish with ldap_msgfree()<B=
R><BR>3. Periodically between the asynchronous searches (after 100 for<BR>e=
xample)you should call ldap_result() with short timer and LDAP_RES_ANY<BR>a=
rgue for clearing stalled or nonfreed calls. The obtained LDAPMessage can<B=
R>be freed with ldap_msgfree(). Of course, you can count the asynch
 calls<BR>which hadn't been completed or were timed out and you can make th=
e<BR>corresponding cycle for checking all iterations.<BR><BR>Please try and=
 let me know.<BR><BR>With respect, Serghei.<BR><BR></DIV></BLOCKQUOTE></TD>=
</TR></TBODY></TABLE><BR></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE><BR><=
/DIV></BLOCKQUOTE></td></tr></table><br>=0A=0A=0A=0A      
--0-1804724661-1266012508=:41453--


Reply via email to