Subject: Should double panic try to dump?
To: None <tech-kern@NetBSD.ORG>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 01/20/1997 15:31:36
Should double panic try to dump?

Right now, a double panic turns on the RB_NOSYNC flag but
persists with trying to cause a crash dump, because it
leaves the RB_DUMP flag set.

I think it would be better to turn off RB_DUMP when we detect
a double panic, based on the theory that trying to do the dump
probably caused the second panic, and we now should give up.

Attached are diffs to implement the change.
Comments?

*** kern/subr_prf.c.orig	Thu Jan  9 17:24:24 1997
--- kern/subr_prf.c	Mon Jan 20 15:26:09 1997
***************
*** 116,126 ****
  	int bootopt;
  	va_list ap;
  
! 	bootopt = RB_AUTOBOOT | RB_DUMP;
! 	if (panicstr)
! 		bootopt |= RB_NOSYNC;
! 	else
  		panicstr = fmt;
  
  	va_start(ap, fmt);
  	printf("panic: %:\n", fmt, ap);
--- 116,129 ----
  	int bootopt;
  	va_list ap;
  
! 	bootopt = RB_AUTOBOOT;
! 	if (!panicstr) {
  		panicstr = fmt;
+ 		bootopt |= RB_DUMP;
+ 	} else {
+ 		/* Double panic. Give up on dump. */
+ 		bootopt |= RB_NOSYNC;
+ 	}
  
  	va_start(ap, fmt);
  	printf("panic: %:\n", fmt, ap);