From owner-freebsd-hackers Wed Jan 8 4:12:36 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47FA537B401 for ; Wed, 8 Jan 2003 04:12:35 -0800 (PST) Received: from piggy.rz.tu-ilmenau.de (piggy.rz.tu-ilmenau.de [141.24.4.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C5AC43ED1 for ; Wed, 8 Jan 2003 04:12:28 -0800 (PST) (envelope-from Martin.Kaeske@Stud.TU-Ilmenau.DE) Received: from gtw.hh59.local (erf9-d9bbe279.pool.mediaWays.net [217.187.226.121]) (authenticated (0 bits)) by piggy.rz.tu-ilmenau.de (8.11.1/8.11.1) with ESMTP id h08CCJn04549 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified NO) ; Wed, 8 Jan 2003 13:12:21 +0100 (MET) Received: from walnut.hh59.local (walnut.hh59.local [192.168.2.10]) by gtw.hh59.local (8.11.3/8.11.3) with ESMTP id h08CM8K29129 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified FAIL) for ; Wed, 8 Jan 2003 13:22:11 +0100 (CET) Received: (qmail 2767 invoked by uid 1000); 8 Jan 2003 12:12:15 -0000 Date: Wed, 8 Jan 2003 13:12:15 +0100 From: Martin Kaeske To: freebsd-hackers@freebsd.org Subject: status of kld in 5.0 Message-ID: <20030108121215.GA1849@walnut.hh59.local> Mail-Followup-To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, Since PR kern/24392 it is not possible to panic the system by loading and unloading a module that is statically compiled into the kernel. I looked into the source (kern_linker.c, kern_module.c, kern_sysctl.c) that is involved in the kld-system to find out where the panics come from. I think i found the problem but no good solution yet. Since 5.0 seems to be released in the near future and the commit-log for kern_linker.c tells that the problem doesn't exist in -current i want to ask wether it is worth trying to fix it for 4-stable or not. Furthermore i wonder if it is a good idea to let kldload return successfully (error==0) if the module is already loaded. If an application loads a module it want some functionality to be present in the system (e.g. ppp), if the required module is already loaded (compiled into kernel or by kldload) it is not an error (the app wants ppp and kldload says "okay, ppp is loaded"). So you can write: if(!(id=kldload(file))) { /* do stuff */ kldunload(id); } wether the module is already present or loaded expicitly by kldload. Thanks in advance Martin PS: for those who are interested, i think the panics come from linker_file_unregister_sysctls calling sysctl_unregister_set and sysctl_unregister_set itself calls sysctl_unregister_oid that removes the oid no matter who loaded it, i think this can be fixed with the help of "struct sysctl_oid"s oid_refcnt -- "At the beginning of the week, we sealed ten BSD programmers into a computer room with a single distribution of BSD Unix. Upon opening the room after seven days, we found all ten programmers dead, clutching each others throats, and thirteen new flavors of BSD." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message