]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
KASSERT: Make runtime optionality optional
authorcem <cem@FreeBSD.org>
Wed, 22 Aug 2018 22:19:42 +0000 (22:19 +0000)
committercem <cem@FreeBSD.org>
Wed, 22 Aug 2018 22:19:42 +0000 (22:19 +0000)
commitffa2c7d287cf92b0f11cb1321e510f520a15bb05
tree6ef17512521f5d4a975e57dd36cc9e65302c186f
parentbd6049115f941359770878ebb297f707f4103866
KASSERT: Make runtime optionality optional

Add an option, KASSERT_PANIC_OPTIONAL, that allows runtime KASSERT()
behavior changes.  When this option is not enabled, code that allows
KASSERTs to become optional is not enabled, and all violated assertions
cause termination.

The runtime KASSERT behavior was added in r243980.

One important distinction here is that panic has __dead2
("attribute((noreturn))"), while kassert_panic does not.  Static analyzers
like Coverity understand __dead2.  Without it, KASSERTs go misunderstood,
resulting in many false positives that result from violation of program
invariants.

Reviewed by: jhb, jtl, np, vangyzen
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16835
sys/conf/NOTES
sys/conf/options
sys/kern/kern_shutdown.c
sys/sys/systm.h