From: "Kottaridis, Chris" Subject: rpc.mountd memory leak Date: Tue, 7 Aug 2007 14:27:39 -0700 Message-ID: <37B62E0F71C9E14B9859FADB1FC3E3E14EB034@ala-mail02.corp.ad.wrs.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C7D939.C81F5E91" To: Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1IIWcQ-0007cV-RY for nfs@lists.sourceforge.net; Tue, 07 Aug 2007 14:29:35 -0700 Received: from mail.windriver.com ([147.11.1.11] helo=mail.wrs.com) by mail.sourceforge.net with esmtp (Exim 4.44) id 1IIWaf-0007EM-Gf for nfs@lists.sourceforge.net; Tue, 07 Aug 2007 14:27:45 -0700 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.wrs.com (8.13.6/8.13.6) with ESMTP id l77LReWm016502 for ; Tue, 7 Aug 2007 14:27:40 -0700 (PDT) List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net This is a multi-part message in MIME format. ------_=_NextPart_001_01C7D939.C81F5E91 Content-Type: multipart/alternative; boundary="----_=_NextPart_002_01C7D939.C81F5E91" ------_=_NextPart_002_01C7D939.C81F5E91 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've got a customer experiencing a small memory leak in rpc.mountd using nfs-utils-1.0.7. For their load it's about 150 KB/day. I have been previously pointed me to a memory leak in add_name in support/export/client.c. Thanks! they were seeing a 6 MB/ day leak before that fix. =20 I've had trouble reproducing the same leak here, but in looking through the code I believe I have come across another possible memory leak in the support/export/client.c file. This time in the client_compose() routine. It may be the source of the current 150 KB/day leak my customer is seeing. =20 I've attached an anlysis from code inspection, but it boils down to the fact that the 'he' variable of client_compose() needs to be xfree'd before client_compose() returns. The 'he' variable is assigned a xmalloc'ed value via either get_hostent() or get_reliable_hostbyaddr(). Once the client_compose() routine returns the pointer will be lost forever. The code is identical in nfs-utils-1.1.0 so I believe the memory leak exists there as well. =20 I'll keep trying to verify that indeed there is a memory leak here, but from code inspection it certainly seems like it. =20 Let me know if you agree that client_compose() has a memory leak. =20 Thanks =20 Chris Kottaridis Senior Engineer Wind River Systems 719-522-9786 =20 ------_=_NextPart_002_01C7D939.C81F5E91 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I've = got a customer=20 experiencing a small memory leak in rpc.mountd using nfs-utils-1.0.7. = For their=20 load it's about 150 KB/day. I have been previously pointed me to a = memory leak=20 in add_name in support/export/client.c. Thanks! they were seeing a = 6 MB/=20 day leak before that fix.
 
I've = had trouble=20 reproducing the same leak here, but in looking through the code I = believe I have=20 come across another possible memory leak in the support/export/client.c = file.=20 This time in the client_compose() routine. It may be the source of the = current=20 150 KB/day leak my customer is seeing.
 
I've = attached an=20 anlysis from code inspection, but it boils down to the fact that the = 'he'=20 variable of client_compose() needs to be xfree'd before client_compose() = returns. The 'he' variable is assigned a xmalloc'ed value via either=20 get_hostent() or get_reliable_hostbyaddr(). Once the client_compose() = routine=20 returns the pointer will be lost forever. The code is identical in=20 nfs-utils-1.1.0 so I believe the
memory = leak exists=20 there as well.
 
I'll = keep trying to=20 verify that indeed there is a memory leak here, but from code inspection = it=20 certainly seems like it.
 
Let me = know if you=20 agree that client_compose() has a memory leak.
 
Thanks
 
Chris = Kottaridis
Senior Engineer
Wind River = Systems
719-522-9786
 
------_=_NextPart_002_01C7D939.C81F5E91-- ------_=_NextPart_001_01C7D939.C81F5E91 Content-Type: application/octet-stream; name="rpcmountd_Notes" Content-Transfer-Encoding: base64 Content-Description: rpcmountd_Notes Content-Disposition: attachment; filename="rpcmountd_Notes" VGhlIHByb2JsZW0gaXMgYSB2ZXJ5IGdyYWR1YWwgbWVtb3J5IGxlYWs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AgICAgICAgICAgIGhlID0gZ2V0X3JlbGlhYmxlX2hvc3RieWFkZHIoKGNvbnN0IGNoYXIqKSZh ZGRyLCBzaXplb2YoYWRkciksIEFGX0lORVQpOwogICAgICAgIGlmIChoZSA9PSBOVUxMKQogICAg ICAgICAgICAgICAgaGUgPSBnZXRfaG9zdGVudCgoY29uc3QgY2hhciopJmFkZHIsIHNpemVvZihh ZGRyKSwgQUZfSU5FVCk7CgogICAgICAgIGZvciAoaSA9IDAgOyBpIDwgTUNMX01BWFRZUEVTOyBp KyspIHsKICAgICAgICAgICAgICAgIG5mc19jbGllbnQgICAgICAqY2xwOwogICAgICAgICAgICAg ICAgZm9yIChjbHAgPSBjbGllbnRsaXN0W2ldOyBjbHAgOyBjbHAgPSBjbHAtPm1fbmV4dCkgewog ICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNsaWVudF9jaGVjayhjbHAsIGhlKSkKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAg ICAgbmFtZSA9IGFkZF9uYW1lKG5hbWUsIGNscC0+bV9ob3N0bmFtZSk7CiAgICAgICAgICAgICAg ICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBuYW1lOwp9Cj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCk5vdGUgdGhhdCB0aGUgJ2hlJyB2 YXJpYWJsZSBnZXRzIGRlZmluZWQgZnJvbSBlaXRoZXIgdGhlCmdldF9yZWxpYWJsZV9ob3N0Ynlh ZGRyKCkgb3IgdGhlIGdldF9ob3N0ZW50KCkgcm91dGluZS4gQm90aCBvZiB0aGVzZSByb3V0aW5l cwpwZXJmb3JtIGEgeG1hbGxvYyB0byBjcmVhdGUgaXQncyByZXR1cm4gdmFsdWUgdGhhdCBnZXRz IHB1dCBpbnRvICdoZScuCgpJbiB0aGUgY2FzZSBvZiBnZXRfaG9zdGVudCgpIHhtYWxsb2Mg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BjYXNlIG9mIGdldF9yZWxpYWJsZV9ob3N0YnlhZGRyKCkgIHlvdSBjYW4gc2VlIGJl bG93IHRoYXQgaXQncwpyZXR1cm5lZCB2YWx1ZSBvZiAnaHAnIGdldHMgZGVmaW5lZCBieSBhIGNh bGwgdG8gaG9zdGVudF9kdXAoKS4KCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09Ci8qIE1hcCBJUCB0byBob3N0bmFtZSwgYW5kIHRoZW4gbWFw IGJhY2sgdG8gYWRkciB0byBtYWtlIHN1cmUgaXQgaXMgYQogKiByZWxpYWJsZSBob3N0bmFtZQog Ki8Kc3RydWN0IGhvc3RlbnQgKgpnZXRfcmVsaWFibGVfaG9zdGJ5YWRkcihjb25zdCBjaGFyICph ZGRyLCBpbnQgbGVuLCBpbnQgdHlwZSkKewogICAgICAgIHN0cnVjdCBob3N0ZW50ICpocCA9IE5V TEw7CgogICAgICAgIHN0cnVjdCBob3N0ZW50ICpyZXZlcnNlOwogICAgICAgIHN0cnVjdCBob3N0 ZW50ICpmb3J3YXJkOwogICAgICAgIGNoYXIgKipzcDsKCiAgICAgICAgcmV2ZXJzZSA9IGdldGhv c3RieWFkZHIgKGFkZHIsIGxlbiwgdHlwZSk7CiAgICAgICAgaWYgKCFyZXZlcnNlKQogICAgICAg ICAgICAgICAgcmV0dXJuIE5VTEw7CgogICAgICAgIC8qIG11c3QgbWFrZSBzdXJlIHRoZSBob3N0 ZW50IGlzIGF1dGhvcmF0aXZlLiAqLwoKICAgICAgICByZXZlcnNlID0gaG9zdGVudF9kdXAgKHJl dmVyc2UpOwogICAgICAgIGZvcndhcmQgPSBnZXRob3N0YnluYW1lIChyZXZlcnNlLT5oX25hbWUp OwoKICAgICAgICBpZiAoZm9yd2FyZCkgewogICAgICAgICAgICAgICAgLyogbm93IG1ha2Ugc3Vy ZSB0aGUgImFkZHIiIGlzIGluIHRoZSBsaXN0ICovCiAgICAgICAgICAgICAgICBmb3IgKHNwID0g Zm9yd2FyZC0+aF9hZGRyX2xpc3QgOyAqc3AgOyBzcCsrKSB7CiAgICAgICAgICAgICAgICAgICAg ICAgIGlmIChtZW1jbXAgKCpzcCwgYWRkciwgZm9yd2FyZC0+aF9sZW5ndGgpID09IDApCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CgogICAg ICAgICAgICAgICAgaWYgKCpzcCkgewogICAgICAgICAgICAgICAgICAgICAgICAvKiBpdCdzIHZh bGlkICovCiAgICAgICAgICAgICAgICAgICAgICAgIGhwID0gaG9zdGVudF9kdXAgKGZvcndhcmQp OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAg ICAgICAgICAgIC8qIGl0IHdhcyBhIEZBS0UgKi8KICAgICAgICAgICAgICAgICAgICAgICAgeGxv ZyAoTF9XQVJOSU5HLCAiRmFrZSBob3N0bmFtZSAlcyBmb3IgJXMgLSBmb3J3YXJkIGxvb2t1cCBk b2Vzbid0IG1hdGNoIHJldmVyc2UiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZl cnNlLT5oX25hbWUsIGluZXRfbnRvYSgqKHN0cnVjdCBpbl9hZGRyKilhZGRyKSk7CiAgICAgICAg ICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgLyogbmV2 ZXIgaGVhcmQgb2YgaXQuIG1pc2NvbmZpZ3VyZWQgRE5TPyAqLwogICAgICAgICAgICAgICAgeGxv ZyAoTF9XQVJOSU5HLCAiRmFrZSBob3N0bmFtZSAlcyBmb3IgJXMgLSBmb3J3YXJkIGxvb2t1cCBk b2Vzbid0IGV4aXN0IiwKICAgICAgICAgICAgICAgICAgICAgIHJldmVyc2UtPmhfbmFtZSwgaW5l dF9udG9hKCooc3RydWN0IGluX2FkZHIqKWFkZHIpKTsKICAgICAgICB9CgogICAgICAgIGZyZWUg KHJldmVyc2UpOwogICAgICAgIHJldHVybiBocDsKfQo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgpUaGUgaG9zdGVudF9kdXAoKSByb3V0aW5l IGdldHMgaXQncyByZXR1cm5lZCB2YWx1ZSBmcm9tIGEgeG1hbGxvYygpOgoKPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpzdHJ1Y3QgaG9zdGVu dCAqCmhvc3RlbnRfZHVwIChzdHJ1Y3QgaG9zdGVudCAqaHApCnsKICBpbnQgbGVuX2VudCA9IGFs aWduIChzaXplb2YgKCpocCksIEFMSUdOTUVOVCk7CiAgaW50IGxlbl9uYW1lID0gYWxpZ24gKHN0 cmxlbiAoaHAtPmhfbmFtZSkgKyAxLCBBTElHTk1FTlQpOwogIGludCBudW1fYWxpYXNlcyA9IDE7 CiAgaW50IGxlbl9hbGlhc2VzID0gc2l6ZW9mIChjaGFyICopOwogIGludCBudW1fYWRkcl9saXN0 ID0gMTsKICBpbnQgbGVuX2FkZHJfbGlzdCA9IHNpemVvZiAoY2hhciAqKTsKICBpbnQgcG9zLCBp OwogIGNoYXIgKipzcDsKICBzdHJ1Y3QgaG9zdGVudCAqY3A7CgogIGZvciAoc3AgPSBocC0+aF9h bGlhc2VzOyBzcCAmJiAqc3A7IHNwKyspCiAgICB7CiAgICAgIG51bV9hbGlhc2VzKys7CiAgICAg IGxlbl9hbGlhc2VzICs9IGFsaWduIChzdHJsZW4gKCpzcCkgKyAxLCBBTElHTk1FTlQpCiAgICAg ICAgICAgICAgICAgICAgICsgc2l6ZW9mIChjaGFyICopOwogICAgfQoKICBmb3IgKHNwID0gaHAt PmhfYWRkcl9saXN0OyAqc3A7IHNwKyspCiAgICB7CiAgICAgIG51bV9hZGRyX2xpc3QrKzsKICAg ICAgbGVuX2FkZHJfbGlzdCArPSBhbGlnbiAoaHAtPmhfbGVuZ3RoLCBBTElHTk1FTlQ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ICAgaGUgPSBnZXRf aG9zdGVudCgoY29uc3QgY2hhciopJmFkZHIsIHNpemVvZihhZGRyKSwgQUZfSU5FVCk7CgogICAg ICAgIGZvciAoaSA9IDAgOyBpIDwgTUNMX01BWFRZUEVTOyBpKyspIHsKICAgICAgICAgICAgICAg IG5mc19jbGllbnQgICAgICAqY2xwOwogICAgICAgICAgICAgICAgZm9yIChjbHAgPSBjbGllbnRs aXN0W2ldOyBjbHAgOyBjbHAgPSBjbHAtPm1fbmV4dCkgewogICAgICAgICAgICAgICAgICAgICAg ICBpZiAoIWNsaWVudF9jaGVjayhjbHAsIGhlKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSA9IGFkZF9uYW1lKG5h bWUsIGNscC0+bV9ob3N0bmFtZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgfQoJaWYgKGhl ICE9IE5VTEwpCgkJeGZyZWUgKGhlKTsKCiAgICAgICAgcmV0dXJuIG5hbWU7Cn0KCg== ------_=_NextPart_001_01C7D939.C81F5E91 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ------_=_NextPart_001_01C7D939.C81F5E91 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs ------_=_NextPart_001_01C7D939.C81F5E91--