From owner-freebsd-current@FreeBSD.ORG Fri Dec 13 22:43:49 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80D34CFF for ; Fri, 13 Dec 2013 22:43:49 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 69DF015E7 for ; Fri, 13 Dec 2013 22:43:49 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id D7D961A3C1D for ; Fri, 13 Dec 2013 14:43:42 -0800 (PST) Message-ID: <52AB8DA1.3000007@mu.org> Date: Fri, 13 Dec 2013 14:43:45 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: kasserts behind invariants References: <1386971425.37172.9.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1386971425.37172.9.camel@powernoodle.corp.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:43:49 -0000 On 12/13/13 1:50 PM, Sean Bruno wrote: > I guess this may have been argued before, but I don't see why we would > want to hide specific things like: sys/kern/subr_lock.c > > /* Check for double-init and zero object. */ > KASSERT(!lock_initalized(lock), ("lock \"%s\" %p already initialized", > name, lock)); > > If I hadn't completely missed the fact that I had INVARIANTS activated, > I'd never have found out why this vendor driver was being so completely > stupid and crashing my machine. > > If I find things like this that I want old KASSERT behavior on (panic if > true) and I don't want to run INVARIANTS, is that possible? I don't understand the question, do you want to move it from INVARIANTS to under just a plain if(condition)? -Alfred