From: deraadt Date: Sat, 19 Feb 2022 23:56:18 +0000 (+0000) Subject: tsleep() prints a stack trace when cold==2. The suspend/resume code has X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b1b9518a9ac571610e42a194d3122bc197d9ccaf;p=openbsd tsleep() prints a stack trace when cold==2. The suspend/resume code has phases where sleeps are not allowed, and this used to discover it. msleep() needs the same check. --- diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index e993131cd9b..d888cb2b84a 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.181 2022/02/14 11:26:05 claudio Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.182 2022/02/19 23:56:18 deraadt Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -222,6 +222,10 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority, if (priority & PCATCH) KERNEL_ASSERT_LOCKED(); +#ifdef DDB + if (cold == 2) + db_stack_dump(); +#endif if (cold || panicstr) { /* * After a panic, or during autoconfiguration,