From owner-freebsd-bugs Wed Jun 16 4:10: 5 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id A27C214C7F for ; Wed, 16 Jun 1999 04:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA36249; Wed, 16 Jun 1999 04:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from jimex.jinr.ru (jimex.jinr.ru [159.93.17.7]) by hub.freebsd.org (Postfix) with ESMTP id 1BB4B14CBB for ; Wed, 16 Jun 1999 04:07:04 -0700 (PDT) (envelope-from isupov@moonhe.jinr.ru) Received: from moonhe.jinr.ru (root@moonhe.jinr.ru [159.93.18.27]) by jimex.jinr.ru (8.8.8/8.8.4) with ESMTP id PAA17263 for ; Wed, 16 Jun 1999 15:06:56 +0400 (MSD) Received: (from isupov@localhost) by moonhe.jinr.ru (8.8.8/8.8.8) id OAA24531; Wed, 16 Jun 1999 14:32:05 +0400 (MSD) (envelope-from isupov) Message-Id: <199906161032.OAA24531@moonhe.jinr.ru> Date: Wed, 16 Jun 1999 14:32:05 +0400 (MSD) From: isupov@moonhe.jinr.ru Reply-To: isupov@moonhe.jinr.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12239: KLD module's load/unload errors handled in strange way (or ignored ?) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12239 >Category: kern >Synopsis: KLD module's load/unload errors handled in strange way (or ignored ?) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 16 04:10:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Isupov A.Yu. >Release: FreeBSD 3.2-RELEASE i386 >Organization: JINR, LHE >Environment: FreeBSD 3.2-RELEASE i386 (need nothing else than standard installation) >Description: 1) If in a KLD module .ko the function _modevent(struct module *module, int cmd, void *arg) returns error at loading time (f.e. : case MOD_LOAD : if (...) { error = ENXIO; break; } ), kldload(8) returns 0 (success !!!) and we have picture of the following style: % kldstat -v Id Refs Address Size Name ... 30 1 0xc0921000 2000 .ko Contains modules: Id Name instead of full absence of .ko here (as was in the 3.0-RELEASE). Such strange object not contains syscall, realised in .ko, and can be successfully removed by kldunload(8), but what the reasons for its appearing at all ?!! 2) If in a KLD module .ko the same function returns error at unloading time (f.e. : case MOD_UNLOAD : if (...) { error = ETXTBSY; break; } ), kldunload(8) returns 1 (nonzero, this seems correct...), .ko still appear in the kldstat output ( % kldstat -v Id Refs Address Size Name ... 31 1 0xc0921000 2000 .ko Contains modules: Id Name 45 ), but syscall, which realises, already removed: % /usr/share/examples/kld/syscall/test/test Bad system call - core dumped (test obtains 12 signal) !!! >How-To-Repeat: Play with /usr/share/examples/kld/syscall/module/syscall.c . >Fix: 1) Don't know, at least because module_register_init() in /sys/kern/kern_module.c of type void now. 2) ??? What are you think, described behaviour is a bug or a feature ? >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message