From owner-freebsd-bugs Tue Jan 7 15:50: 4 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3EC5C37B401 for ; Tue, 7 Jan 2003 15:50:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65C4E43EA9 for ; Tue, 7 Jan 2003 15:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h07No1NS080612 for ; Tue, 7 Jan 2003 15:50:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h07No1e0080611; Tue, 7 Jan 2003 15:50:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC06A37B401 for ; Tue, 7 Jan 2003 15:41:37 -0800 (PST) Received: from merlot.juniper.net (natint.juniper.net [207.17.136.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13BD443EDC for ; Tue, 7 Jan 2003 15:41:37 -0800 (PST) (envelope-from dsw@juniper.net) Received: from sophia.juniper.net (sophia.juniper.net [172.17.12.140]) by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id h07NfaS12345 for ; Tue, 7 Jan 2003 15:41:36 -0800 (PST) (envelope-from dsw@juniper.net) Received: (from dsw@localhost) by sophia.juniper.net (8.11.6/8.9.3) id h07NfaQ01188; Tue, 7 Jan 2003 15:41:36 -0800 (PST) (envelope-from dsw) Message-Id: <200301072341.h07NfaQ01188@sophia.juniper.net> Date: Tue, 7 Jan 2003 15:41:36 -0800 (PST) From: David Wang Reply-To: David Wang To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/46845: inetd memory leak when built with LOGIN_CAP Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46845 >Category: bin >Synopsis: inetd memory leak when built with LOGIN_CAP >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 07 15:50:00 PST 2003 >Closed-Date: >Last-Modified: >Originator: David Wang >Release: FreeBSD 4.2-STABLE i386 >Organization: Juniper Networks >Environment: System: FreeBSD sophia.juniper.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sat Mar 23 12:22:23 PST 2002 root@sophia:/usr/src/sys/compile/Juniper i386 >Description: With LOGIN_CAP defined during compilation, inetd.c calls login_getclass(), which returns a dynamically-allocated chunk of memory of size sizeof(login_cap_t). login_close() should be called at some point to free up this chunk of memory, but login_close() is never called in inetd.c. Note that other code in FreeBSD does call login_close() to free up memory allocated by login_getclass() and friends. I saw this behavior in FreeBSD 4.2 but it seems that the problem exists in all versions of FreeBSD. >How-To-Repeat: Build inetd with LOGIN_CAP defined, and send SIGHUPs to the resulting inetd executable. 'ps ux | grep inetd' output will show the memory being used by inetd will go up. >Fix: Call login_close() after calls to login_getclass(), if the login_cap_t that is allocated is not needed anymore. This will especially help in the loop inside config(). >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message