Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern On a recursive panic(), don't try to take a dump, a...



details:   https://anonhg.NetBSD.org/src/rev/09feec9e9b7d
branches:  trunk
changeset: 751154:09feec9e9b7d
user:      he <he%NetBSD.org@localhost>
date:      Tue Jan 26 12:59:50 2010 +0000

description:
On a recursive panic(), don't try to take a dump, as that may very
well have triggered the recursive panic.
Fix the comment for panic() to reflect now-current reality: the code
was already changed never to sync() on panic(), now we avoid dumping
core on a recursive panic.

diffstat:

 sys/kern/subr_prf.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 194d06ef7a3b -r 09feec9e9b7d sys/kern/subr_prf.c
--- a/sys/kern/subr_prf.c       Tue Jan 26 12:45:46 2010 +0000
+++ b/sys/kern/subr_prf.c       Tue Jan 26 12:59:50 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_prf.c,v 1.137 2009/11/03 05:23:28 dyoung Exp $    */
+/*     $NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $        */
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.137 2009/11/03 05:23:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -202,8 +202,7 @@
  * panic: handle an unresolvable fatal error
  *
  * prints "panic: <message>" and reboots.   if called twice (i.e. recursive
- * call) we avoid trying to sync the disk and just reboot (to avoid
- * recursive panics).
+ * call) we avoid trying to dump and just reboot (to avoid recursive panics).
  */
 
 void
@@ -246,8 +245,12 @@
        }
 
        bootopt = RB_AUTOBOOT | RB_NOSYNC;
-       if (dumponpanic)
-               bootopt |= RB_DUMP;
+       if (!doing_shutdown) {
+               if (dumponpanic)
+                       bootopt |= RB_DUMP;
+       } else
+               printf("Skipping crash dump on recursive panic\n");
+
        if (!panicstr)
                panicstr = fmt;
        doing_shutdown = 1;



Home | Main Index | Thread Index | Old Index