From owner-freebsd-arch@freebsd.org Wed May 11 16:04:06 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD4DB37334 for ; Wed, 11 May 2016 16:04:06 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 836241695 for ; Wed, 11 May 2016 16:04:06 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from Alfreds-MacBook-Pro-2.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 1D59C346DE31 for ; Wed, 11 May 2016 09:04:00 -0700 (PDT) Subject: Re: KASSERT: always assert; KWARN To: freebsd-arch@freebsd.org References: From: Alfred Perlstein Organization: FreeBSD Message-ID: Date: Wed, 11 May 2016 09:04:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2016 16:04:06 -0000 On 5/10/16 6:24 PM, Conrad Meyer wrote: > Thoughts or objections? Does anyone like the ability to opt out of > invariants asserts? Yes. During my time at iXsystems we used this facility several times to get a log from a customer site with a number of "kasserts". The reason we did this was multiple reasons: 1) We needed to ship a kernel with asserts enabled. 2) When we did, the first assert hit was: a) In an unrelated module and not relevant. b) Not enough information came back from just the first assert. 3) We found it more useful to get multiple errors back from a customer in one trip rather than one fix at a time. Unfortunately one fix at a time would have had us lose the customer. The KASSERT/assert system is very, very, very useful. However if you are at a last resort sending a debug kernel (with Kassert enabled) and do not get enough information back then you will lose that customer. I understand that a few vocal folks are upset, like seriously, seriously upset, however at the time this was the only way we could effectively debug a customer problem and my hope was that others could make use of it as well. Linux has had a similar functionality for many years. In Linux there is the kernel "oops()" which does nearly the same thing. Initially I mocked Linux's "oops" for being silly and "wrong", using the exact same reasons that many have used to dislike "kassert_warn". However once I was responsible for an extremely pissed off customer who was paying us quite a sum of money AND I was not getting enough information back, I changed my mind. https://en.wikipedia.org/wiki/Linux_kernel_oops -Alfred