From owner-cvs-all Tue Sep 5 16:30:13 2000 Delivered-To: cvs-all@freebsd.org Received: from mailgate.originative.co.uk (mailgate.originative.co.uk [194.217.50.228]) by hub.freebsd.org (Postfix) with ESMTP id EFFE237B423; Tue, 5 Sep 2000 16:30:08 -0700 (PDT) Received: from netsynergy.co.uk (lobster.originative.co.uk [194.217.50.241]) by mailgate.originative.co.uk (Postfix) with ESMTP id 72C361D140; Wed, 6 Sep 2000 00:30:06 +0100 (BST) Message-ID: <39B581FE.7E78128B@netsynergy.co.uk> Date: Wed, 06 Sep 2000 00:30:06 +0100 From: Paul Richards Organization: Net Synergy Ltd X-Mailer: Mozilla 4.74 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Don Lewis Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern init_main.c kern_exec.c kern_exit.ckern_fork.c kern_proc.c kern_prot.c kern_resource.c uipc_socket.cuipc_socket2.c uipc_usrreq.c vfs_aio.c src/sys/sys proc.hresourcevar.h ucred.h References: <200009052211.PAA70424@freefall.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don Lewis wrote: > > Change KASSERTs in this code to unconditional tests and calls to panic(). I think we should have some style guidelines about KASSERTS, INVARIANTS and panic et al. I don't think panic should be used unless it is an environmental effect that the kernel needs to trap i.e. a disk is failing and it's better to panic if data looks funny than make corruption worse, for example. A panic shouldn't be used to catch bugs, those should be tested for using debugging tools such as KASSERTS wrapped in INVARIANTS, even if they then call panic to get a core dump. (I haven't looked at these diffs and there may be good security reasons for always checking and calling panic in this case but in general there's been a trend recently to put debugging code in the production code rather than putting it inside INVARIANTS.) Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message