HomeFreeBSD

KASSERT: Make runtime optionality optional

Description

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

Details

Provenance
cemAuthored on
Reviewer
jhb
Differential Revision
D16835: KASSERT: Make runtime optionality optional
Parents
rS338213: Add support for send, receive and state-change DTrace providers for
Branches
Unknown
Tags
Unknown