From owner-freebsd-bugs@freebsd.org Fri Dec 20 21:13:27 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AC8C1E37FA for ; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47fhLH2jNbz4QGl for ; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 5B27F1E37F9; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AED01E37F7 for ; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fhLH1m82z4QGk for ; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37BB54E57 for ; Fri, 20 Dec 2019 21:13:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLDRiR038140 for ; Fri, 20 Dec 2019 21:13:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xBKLDRE9038126 for bugs@FreeBSD.org; Fri, 20 Dec 2019 21:13:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 242746] Deleting (or re-setting) an IP address with ifconfig holds (leaks?) memory Date: Fri, 20 Dec 2019 21:13:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: ghuckriede@blackberry.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:13:27 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242746 Bug ID: 242746 Summary: Deleting (or re-setting) an IP address with ifconfig holds (leaks?) memory Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: ghuckriede@blackberry.com Overview: Setting an IP address consumes 'ifaddr' typed memory. When destroying the = IP address the memory is not freed. This memory does not appear to be collected later, as running the below scr= ipt shows no recovery after continuously re-setting the ip address for 16 hours. The leaked memory was tracked down to the ifa_alloc() function, see line 84= 5 of https://svnweb.freebsd.org/base/head/sys/net/if.c?revision=3D355070&view=3D= markup Instrumenting the code revealed that there are more ifa_ref() calls than ifa_free() calls. This results in the memory being held, as the system believes there is still a reference to this memory. Steps to Reproduce: 'ifconfig inet' an address and then 'ifconfig inet delete' it. Actual Results: # vmstat -m | grep ifaddr ifaddr 141 36K - 235 16,32,64,128,256,512,2048,4096 #=20 # ifconfig em1 inet 192.168.200.44 # vmstat -m | grep ifaddr ifaddr 142 36K - 236 16,32,64,128,256,512,2048,4096 # ifconfig em1 inet delete 192.168.200.44 # vmstat -m | grep ifaddr ifaddr 142 36K - 236 16,32,64,128,256,512,2048,4096 # cat /tmp/loop while true do ifconfig em1 192.168.200.33=20 sleep 1=20 vmstat -m | grep ifaddr done # /tmp/loop ifaddr 135 37K - 294 16,32,64,128,256,512,2048,4096 ifaddr 136 38K - 295 16,32,64,128,256,512,2048,4096 ifaddr 137 38K - 296 16,32,64,128,256,512,2048,4096 ifaddr 138 39K - 297 16,32,64,128,256,512,2048,4096 ....snip (16 hours worth of logs)... ifaddr 1834875 917406K - 1835088 16,32,64,128,256,512,2048,4= 096 ifaddr 1834876 917407K - 1835089 16,32,64,128,256,512,2048,4= 096 ifaddr 1834877 917407K - 1835090 16,32,64,128,256,512,2048,4= 096 ifaddr 1834878 917408K - 1835091 16,32,64,128,256,512,2048,4= 096 ifaddr 1834879 917408K - 1835092 16,32,64,128,256,512,2048,4= 096 ^C # Expected Results: Not to leak/hold onto memory. Build Date & Hardware: HEADr355854 on amd64 target with any networking interface --=20 You are receiving this mail because: You are the assignee for the bug.=