From owner-freebsd-current Sat Sep 8 17:49:37 2001 Delivered-To: freebsd-current@freebsd.org Received: from taxismtp2.alchemyfx.com (taxismtp2.alchemy.net [209.132.220.152]) by hub.freebsd.org (Postfix) with ESMTP id A9BE037B409; Sat, 8 Sep 2001 17:49:32 -0700 (PDT) Received: from localhost (L013152.ppp.dion.ne.jp [211.126.13.152]) by taxismtp2.alchemyfx.com (8.9.3/8.9.3) with ESMTP id RAA03215; Sat, 8 Sep 2001 17:52:06 -0700 From: neckpain@nettaxi.com Message-Id: <200109090052.RAA03215@taxismtp2.alchemyfx.com> Date: Sun, 9 Sep 2001 09:49:59 +0900 To: cc@devcon.net Cc: roam@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: problem with dynamic sysctls in -current References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.20i-ja0 X-Dispatcher: imput version 20000228(IM140) Lines: 73 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Sep 08, 2001 at 10:27:10PM +0200, Christian Carstensen wrote: > > hmm, > > i've posted the attached mail a week ago to this list, but got no > response. could someone please comment on this issue? I've also posted a patch(much less refined than yours, though) last month but still got no response. Maybe you need to talk to the person who committed rev 1.112 of kern_sysctl.c ? > ---------- Forwarded message ---------- > Date: Sat, 1 Sep 2001 03:26:46 +0200 (CEST) > From: Christian Carstensen > To: current@freebsd.org > Subject: dynamic sysctl problem and proposed hot fix > > > hi, > > i just came across a problem with dynamic sysctls: > when unloading a driver module that used dyn sysctls, my system paniced > with "oid too high". that problem is caused by sysctl_ctx_free() in > kern/kern_sysctl.c, that first deregisters all oids in the list to see if > a error occurs. then, all oids are being reregistered and, if there was no > error, they're finally removed. > during the second phase, sysctl_register_oid(e1->entry) is called with > n := e1->entry->oid_number being the old oid number with n > CTL_AUTO_START. > that leads to panic("static sysctl too high") in sysctl_register_oid. > one approach might be to initialize the oid_number field to contain the > value OID_AUTO before calling sysctl_regiser_oid, but i'm unsure about the > side effects of doing that in sysctl_ctx_free(). > alternatively, the "old" oid number could be reused, the following patch > should do, but it's just a workaround. > > > best, > christian > > -- > "Sorry, no defects found. Please try a different search" > [http://www.cisco.com/support/bugtools/bugtool.shtml] > > > Index: kern_sysctl.c > =================================================================== > RCS file: /usr/cvs/src/sys/kern/kern_sysctl.c,v > retrieving revision 1.113 > diff -r1.113 kern_sysctl.c > 83a84,96 > > static struct sysctl_oid * > > sysctl_find_oidnumber(const int number, struct sysctl_oid_list *list) > > { > > struct sysctl_oid *oidp; > > > > SLIST_FOREACH(oidp, list, oid_link) { > > if (oidp->oid_number == number) { > > return (oidp); > > } > > } > > return (NULL); > > } > > > 125c138,139 > < panic("static sysctl oid too high: %d", oidp->oid_number); > --- > > if (sysctl_find_oidnumber(oidp->oid_number, parent)) > > panic("static sysctl oid too high: %d", oidp->oid_number); > 177c191 > < if (error) > --- > > if (error) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message