diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2018-04-24 19:10:51 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2018-04-24 19:10:51 +0000 |
commit | 65df12484508401ce2ee43b2f4e21ba77a8a5670 (patch) | |
tree | ba87597bad28399218eabdbcdee62480b6f415bd /sys/kern/kern_shutdown.c | |
parent | c36b068bc10183a3146ca41bc83cbb2a9cb463e1 (diff) | |
download | src-65df12484508401ce2ee43b2f4e21ba77a8a5670.tar.gz src-65df12484508401ce2ee43b2f4e21ba77a8a5670.zip |
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
Notes
Notes:
svn path=/head/; revision=332962
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 7547c1a5e7c7..b1d652e85c63 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -718,15 +718,26 @@ 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 * kassert_log_panic_at warnings. */ |