Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Sep 2014 07:53:26 -0700
From:      Justin Hibbits <jhibbits@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Bryan Drewery <bdrewery@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread
Message-ID:  <CAHSQbTBPSFX251WPvNMVMS4f_uqQVaW5JWFmcQtsVWjB6tWbUA@mail.gmail.com>
In-Reply-To: <54267CAE.4090009@FreeBSD.org>
References:  <54236CD6.4050807@FreeBSD.org> <CACYV=-Eg69AQ72DOGppPSL7whJVCdcNg-auhBZ771iG7DfPdAw@mail.gmail.com> <5424392D.9030201@FreeBSD.org> <CAJ-Vmok5Xaa6aZvfL1GoW8C==dY47P=vKAEZhu16JhHjV%2BTk9g@mail.gmail.com> <CACYV=-GMpMxEAs-X7umMdYX2Awf3G0La1cUGsXeH9MoX34CdxQ@mail.gmail.com> <1411668571.66615.247.camel@revolution.hippie.lan> <CACYV=-HDVxhQ=CDK7HWuK2t-rsFkW2gKD45NDjC86jQ2wq6v9A@mail.gmail.com> <CAHSQbTCwwxvudijaanvUohF9Em_%2B2%2Bac-%2B1j0OEcNFY=vEx2gA@mail.gmail.com> <5425CAB6.2010102@FreeBSD.org> <54267CAE.4090009@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 27, 2014 2:01 AM, "Andriy Gapon" <avg@freebsd.org> wrote:
>
> On 26/09/2014 23:21, Bryan Drewery wrote:
> > On 9/25/2014 1:22 PM, Justin Hibbits wrote:
> >> I like my bikeshed a nice royal blue.  At a previous job we used
> >> ASSERT and VERIFY macros.  VERIFY was comparable to this (warn if
> >> condition not met, don't panic), so how about KVERIFY() (I'll also
> >> support KWARN, but I think KVERIFY() conveys a better message by
> >> name).
> >
> > I will commit it as KVERIFY tonight based on the majority consensus.
> > Even at work right now we are tracking down an odd bug where this could
> > be useful to have temporarily.
> >
>
> Not sure if the following bit of information will influence your
decision, but
> anyway.  In the Solaris source code ASSERT is used like our KASSERT where
DEBUG
> macro controls its definition like our INVARIANTS do.  But VERIFY is used
like
> KASSERT that is never compiled out.  So, my personal preference would be
to use
> KWARN for something that only warns.
>

That sounds like pretty good precedent.  I fully support it or Davide's
DEBUG_WARN suggestion, and agree it makes more sense than KVERIFY from this
context.

-Justin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHSQbTBPSFX251WPvNMVMS4f_uqQVaW5JWFmcQtsVWjB6tWbUA>