From owner-freebsd-arch@freebsd.org Wed May 11 01:24:28 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 4EA1FB36639 for ; Wed, 11 May 2016 01:24:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 334651822 for ; Wed, 11 May 2016 01:24:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 2F316B36638; Wed, 11 May 2016 01:24:28 +0000 (UTC) Delivered-To: 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 2CA95B36636 for ; Wed, 11 May 2016 01:24:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6A921820; Wed, 11 May 2016 01:24:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f44.google.com with SMTP id x201so44591566oif.3; Tue, 10 May 2016 18:24:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:date:message-id:subject :from:to:cc; bh=gysBeLLIBl7o8s9x6cV3t7g33eYMcXQskf18XVDDAvE=; b=HAHuRBMPutKgIXeb/rRM7DOJkBJOZtt+n45U8rXx7LT7jcGIPYrD+s9dN76fUJkr/b O2vKK1aJTJ4SxS4QEN+M9ApMt1Spdupyb/H2T+8JKK5XANC5dwDOVZVi5Ar568F9TnV7 QjBYofMPpUJbSc4tEahSr+8hS4NwwQLKR1ZuKBEKy1spdkwvOx3OlXUUfv6tLM0Ez4R+ KO91Oy+Gh7T8zlo8SXzJVfIeJJXuaDjW8bV1huhONeMUNMo0SZIh0WSnj1ry7NtbbSmE X48Y2vh4KdJOytHxUB/gRT6TQNTGQcOF/QypZ1Ph1MXp+ej0zIHXjj5ZhAaOJQ71SUXE 75bw== X-Gm-Message-State: AOPr4FUo+3iCDogVLsqowohosdmwHPeCJgzAtJOIXVVdO+aEjprGd+IFz2hN6RT5kPgz1g== X-Received: by 10.157.12.241 with SMTP id o46mr354409otd.16.1462929861267; Tue, 10 May 2016 18:24:21 -0700 (PDT) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id u11sm1363398oie.29.2016.05.10.18.24.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 May 2016 18:24:21 -0700 (PDT) Received: by mail-oi0-f46.google.com with SMTP id v145so44535926oie.0; Tue, 10 May 2016 18:24:20 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.102.222 with SMTP id m91mr309517oik.79.1462929860761; Tue, 10 May 2016 18:24:20 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 10 May 2016 18:24:20 -0700 (PDT) Date: Tue, 10 May 2016 18:24:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: KASSERT: always assert; KWARN From: Conrad Meyer To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 01:24:28 -0000 I'd like to logically revert r243980 and r244105, such that KASSERT uses the __dead2-annotated panic(9). Going back to the old behavior enables Coverity and other static analyzers to reason about KASSERT invariants via the __dead2 panic(9) path. This proposal is in https://reviews.freebsd.org/D6117 . As a follow-up, to match the assumed intent of the r243980 changes, I propose a KWARN facility which may be muted, rate limited, or even cause panic. Generally, KASSERTs should not be KWARNs. That proposal is here: https://reviews.freebsd.org/D6134 Finally, I am looking for suggestions of things it *does* make sense to KWARN about. One suggestion was witness_warn; however, it doesn't seem like a great fit (without adding allocating sbufs in, anyway). A sketch of that is in https://reviews.freebsd.org/D6306 . Thoughts or objections? Does anyone like the ability to opt out of invariants asserts? Best, Conrad