Subject: Disabling kernel assertions on panic
To: None <tech-kern@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 07/24/2007 21:20:43
Hi,

A lot of assertions have been added into the kernel, making it difficult to
get a diagnostic system to reboot after it has paniced. Any thoughts on the
following?

Andrew

Index: __assert.c
===================================================================
RCS file: /cvsroot/src/sys/lib/libkern/__assert.c,v
retrieving revision 1.8
diff -u -p -r1.8 __assert.c
--- __assert.c	11 Dec 2005 12:24:37 -0000	1.8
+++ __assert.c	24 Jul 2007 20:12:56 -0000
@@ -42,6 +42,9 @@ void
 __assert(const char *t, const char *f, int l, const char *e)
 {
 
+	if (panicstr != NULL)
+		return;
+
 	panic("kernel %sassertion \"%s\" failed: file \"%s\", line %d",
-	      t, e, f, l);
+	    t, e, f, l);
 }
Index: libkern.h
===================================================================
RCS file: /cvsroot/src/sys/lib/libkern/libkern.h,v
retrieving revision 1.69
diff -u -p -r1.69 libkern.h
--- libkern.h	9 Apr 2007 17:39:37 -0000	1.69
+++ libkern.h	24 Jul 2007 20:12:56 -0000
@@ -285,8 +285,7 @@ int	 ffs __P((int));
 #define	ffs(x)		__builtin_ffs(x)
 #endif
 
-void	 __assert __P((const char *, const char *, int, const char *))
-	    __attribute__((__noreturn__));
+void	 __assert __P((const char *, const char *, int, const char *));
 unsigned int
 	bcdtobin __P((unsigned int));
 unsigned int