Index: ddb/db_command.c =================================================================== RCS file: /cvsroot/src/sys/ddb/db_command.c,v retrieving revision 1.148.8.2 diff -p -u -r1.148.8.2 db_command.c --- ddb/db_command.c 31 Jul 2018 17:01:20 -0000 1.148.8.2 +++ ddb/db_command.c 7 Sep 2018 01:17:12 -0000 @@ -1351,6 +1351,10 @@ db_reboot_cmd(db_expr_t addr, bool have_ * called from cpu_reboot. */ db_recover = 0; + /* Avoid all mutex errors */ +#ifdef LOCKDEBUG + lockdebug_dismiss(); +#endif panicstr = "reboot forced via kernel debugger"; cpu_reboot((int)bootflags, NULL); #else /* _KERNEL */ Index: kern/subr_lockdebug.c =================================================================== RCS file: /cvsroot/src/sys/kern/subr_lockdebug.c,v retrieving revision 1.57.2.1 diff -p -u -r1.57.2.1 subr_lockdebug.c --- kern/subr_lockdebug.c 2 Apr 2018 09:07:52 -0000 1.57.2.1 +++ kern/subr_lockdebug.c 7 Sep 2018 01:17:12 -0000 @@ -977,6 +977,19 @@ lockdebug_show_lockstats(void (*pr)(cons #endif /* DDB */ /* + * lockdebug_dismiss: + * + * The system is rebooting, and potentially from an unsafe + * place so avoid any future aborts. + */ +void +lockdebug_dismiss(void) +{ + + atomic_inc_uint_nv(&ld_panic); +} + +/* * lockdebug_abort: * * An error has been trapped - dump lock info and call panic(). Index: sys/lockdebug.h =================================================================== RCS file: /cvsroot/src/sys/sys/lockdebug.h,v retrieving revision 1.15.6.1 diff -p -u -r1.15.6.1 lockdebug.h --- sys/lockdebug.h 2 Apr 2018 09:07:53 -0000 1.15.6.1 +++ sys/lockdebug.h 7 Sep 2018 01:17:12 -0000 @@ -53,6 +53,7 @@ typedef struct lockops { #define LOCKDEBUG_ABORT(f, ln, l, o, m) \ lockdebug_abort(f, ln, l, o, m) +void lockdebug_dismiss(void); void lockdebug_abort(const char *, size_t, volatile void *, lockops_t *, const char *);