svn commit: r332962 - head/sys/kern
Conrad Meyer
cem at FreeBSD.org
Tue Apr 24 19:10:52 UTC 2018
Author: cem
Date: Tue Apr 24 19:10:51 2018
New Revision: 332962
URL: https://svnweb.freebsd.org/changeset/base/332962
Log:
Do not totally silence suppressed secondary kasserts unless debug.kassert.do_log is disabled
To totally silence and ignore secondary kassert violations after a primary
panic, set debug.kassert.do_log=0 and debug.kassert.suppress_in_panic=1.
Additional assertion warnings shouldn't block core dump and may alert the
developer to another erroneous condition. Secondary stack traces may be
printed, identically to the unsuppressed case where panic() is reentered --
controlled via debug.trace_all_panics.
Sponsored by: Dell EMC Isilon
Modified:
head/sys/kern/kern_shutdown.c
Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c Tue Apr 24 19:09:53 2018 (r332961)
+++ head/sys/kern/kern_shutdown.c Tue Apr 24 19:10:51 2018 (r332962)
@@ -718,13 +718,24 @@ kassert_panic(const char *fmt, ...)
static char buf[256];
va_list ap;
- /* If we already panic'd, don't create a double-fault. */
- if (panicstr != NULL && kassert_suppress_in_panic)
- return;
-
va_start(ap, fmt);
(void)vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
+
+ /*
+ * If we are suppressing secondary panics, log the warning but do not
+ * re-enter panic/kdb.
+ */
+ if (panicstr != NULL && kassert_suppress_in_panic) {
+ if (kassert_do_log) {
+ printf("KASSERT failed: %s\n", buf);
+#ifdef KDB
+ if (trace_all_panics && trace_on_panic)
+ kdb_backtrace();
+#endif
+ }
+ return;
+ }
/*
* panic if we're not just warning, or if we've exceeded
More information about the svn-src-all
mailing list