From owner-freebsd-bugs Thu May 30 12:50:18 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8470C37B404 for ; Thu, 30 May 2002 12:50:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4UJo6617951; Thu, 30 May 2002 12:50:06 -0700 (PDT) (envelope-from gnats) Received: from mailman.packetdesign.com (dns.packetdesign.com [65.192.41.10]) by hub.freebsd.org (Postfix) with ESMTP id 3F59337B400 for ; Thu, 30 May 2002 12:41:55 -0700 (PDT) Received: from bubba.packetdesign.com (bubba.packetdesign.com [192.168.0.223]) by mailman.packetdesign.com (8.11.6/8.11.6) with ESMTP id g4UJftb49812 for ; Thu, 30 May 2002 12:41:55 -0700 (PDT) (envelope-from archie@packetdesign.com) Received: (from archie@localhost) by bubba.packetdesign.com (8.11.6/8.11.6) id g4UJfsP47284; Thu, 30 May 2002 12:41:54 -0700 (PDT) (envelope-from archie) Message-Id: <200205301941.g4UJfsP47284@bubba.packetdesign.com> Date: Thu, 30 May 2002 12:41:54 -0700 (PDT) From: Archie Cobbs Reply-To: Archie Cobbs To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/38745: improper ordering of mbinit() wrt. device drivers 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: 38745 >Category: kern >Synopsis: improper ordering of mbinit() wrt. device drivers >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 30 12:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Archie Cobbs >Release: FreeBSD 4.5-RELEASE i386 >Organization: Packet Design >Environment: System: FreeBSD bubba.packetdesign.com 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sun Feb 3 10:00:07 PST 2002 archie@bubba.packetdesign.com:/usr/obj/usr/src/sys/BUBBA i386 >Description: The problem is that: (a) Some drivers (e.g., fxp) allocate mbuf's in their device attach routine. (b) mbinit() is called after the device attach routines This means that memory is leaked at startup time because the first thing mbinit() does is set mmbfree and mclfree to NULL. >How-To-Repeat: Build kernel with fxp driver. Boot with debugger enabled. Set breakpoints at mmbinit() and m_mballoc(). Notice that the m_mballoc() breakpoint is first. >Fix: Seems like SI_SUB_MBUF needs to be moved earlier, or else add a static flag to uipc_mbuf.c so that m_mballoc() and m_clalloc() can check whether mbinit() has been called yet and if not call it. If the latter approach is done, then we might as well get rid of the mbinit() SYSINIT since it becomes redundant. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message