From alinachegalati@yahoo.com Fri Feb 12 22:09:15 2010 From: alinachegalati@yahoo.com To: openldap-bugs@openldap.org Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT Date: Fri, 12 Feb 2010 22:09:15 +0000 Message-ID: <201002122209.o1CM9Fol068983@boole.openldap.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2685161609822667027==" --===============2685161609822667027== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable --0-1804724661-1266012508=3D:41453 Content-Type: text/plain; charset=3Diso-8859-1 Content-Transfer-Encoding: quoted-printable On point to note, i have the same situation as here : http://www.openldap.o=3D rg/lists/openldap-technical/200912/msg00007.html --- On Fri, 2/12/10, alin vasile wrote: From: alin vasile Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT To: linamat(a)telco.md Cc: openldap-its(a)OpenLDAP.org Date: Friday, February 12, 2010, 1:56 PM looping openldap group --- On Fri, 2/12/10, alin vasile wrote: From: alin vasile Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT To: linamat(a)telco.md Date: Friday, February 12, 2010, 1:55 PM Hi Serghei, =3DA0 =3DA0=3DA0=3DA0=3DA0 For the first point, the function ldap_msgfree=3DA0 will= check f=3D or NULL, so if the check is missing, no error occurs. =3DA0 =3DA0=3DA0=3DA0 I am using the ldap_search_ext_s function (the synchronous on= e) s=3D o the second and third point doesn't apply as i don't have access to the ms=3D gid. If the memory leak is high maybe will switch to the async queries. =3DA0 Regards, Alin =3DA0 =3DA0=3DA0=3D20 =3DA0=3DA0=3DA0=3D20 --- On Fri, 2/12/10, linamat(a)telco.md wrote: From: linamat(a)telco.md Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT To: openldap-its(a)OpenLDAP.org Cc: alinachegalati(a)yahoo.com Date: Friday, February 12, 2010, 1:34 PM Buna ziua, domnule. 1. The pointer must be checked before operation, e.g. if (res !=3D3D NULL) { =3DA0 =3DA0 ldap_msgfree (res); =3DA0 =3DA0 res =3D3D 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. =3D0A=3D0A=3D0A =20 --0-1804724661-1266012508=3D:41453 Content-Type: text/html; charset=3Diso-8859-1 Content-Transfer-Encoding: quoted-printable
On point to note, i have the same situation a= =3D s here : http://www.openldap.org/lists/openldap-technical/200912/msg=3D 00007.html

--- On Fri, 2/12/10, alin vasile <alinachega=3D lati(a)yahoo.com> wrote:

From: alin vasile <alinachegalati(a)yahoo.com>= =3D ;
Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: li=3D namat(a)telco.md
Cc: openldap-its(a)OpenLDAP.org
Date: Friday, February= 1=3D 2, 2010, 1:56 PM

looping openldap group

--- On Fri, 2/12/10, alin= =3D vasile <alinachegalati(a)yahoo.com> wrote:

From: alin vasile <alinachegalati(a)yahoo.com>= =3D ;
Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: li=3D namat(a)telco.md
Date: Friday, February 12, 2010, 1:55 PM

=3D
Hi Serghei,
 
     For the first point, the function ldap_msgfre=3D e  will check for NULL, so if the check is missing, no error occurs.
 
    I am using the ldap_search_ext_s function (the sync=3D hronous one) so the second and third point doesn't apply as i don't have ac=3D cess to the msgid. If the memory leak is high maybe will switch to the asyn=3D c queries.
 
Regards,
Alin
 
  
   

--- On Fri, 2/12/10, linamat(a)telco.md <linamat(a)telco.md> wrote:

From: linamat(a)telco.md <linamat(a)telco.md>= Subject: Re: (ITS#6453) OpenLDAP memory leak on LDAP_TIMEOUT
To: openl=3D dap-its(a)OpenLDAP.org
Cc: alinachegalati(a)yahoo.com
Date: Friday, Feb= ru=3D ary 12, 2010, 1:34 PM

Buna ziua, domnule.

1. The pointer must be ch= =3D ecked before operation, e.g.
if (res !=3D3D NULL) {
    ldap_= =3D msgfree (res);
    res =3D3D NULL;
}

2. Also while pro= =3D cessing the ext query, you should call the functions in
the following ma=3D nner:
2.1 ldap_search_ext() which has pointer to msgid
2.2 ldap_resul=3D t() which gives the LDAPMessage structure for the msgid
2.3 if ok - ldap=3D _parse_result()
2.4 on any stage if something is not good and you have t=3D he msgid filled
with value (integer, typicaly more then 1) you should ca=3D ll
ldap_abandon_ext() for that msgid
2.5 Finish with ldap_msgfree()
3. Periodically between the asynchronous searches (after 100 for
e=3D xample)you should call ldap_result() with short timer and LDAP_RES_ANY
a=3D rgue for clearing stalled or nonfreed calls. The obtained LDAPMessage canbe 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 th=3D e
corresponding cycle for checking all iterations.

Please try and=3D let me know.

With respect, Serghei.



<=3D /DIV>

=3D0A=3D0A=3D0A=3D0A =20 --0-1804724661-1266012508=3D:41453-- --===============2685161609822667027==--