Module Name:    src
Committed By:   jmcneill
Date:           Sun Sep  4 12:17:59 UTC 2011

Modified Files:
        src/sys/arch/usermode/usermode: trap.c

Log Message:
mem_access_handler: panic if we receive sigsegv or sigbus with SI_NOINFO,
and when "peeing outside the box" print the offending va


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/usermode/usermode/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.20 src/sys/arch/usermode/usermode/trap.c:1.21
--- src/sys/arch/usermode/usermode/trap.c:1.20	Sat Sep  3 15:33:56 2011
+++ src/sys/arch/usermode/usermode/trap.c	Sun Sep  4 12:17:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.20 2011/09/03 15:33:56 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.21 2011/09/04 12:17:59 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.20 2011/09/03 15:33:56 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.21 2011/09/04 12:17:59 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -152,6 +152,10 @@
 		printf("\tsi_trap = %d\n", info->si_trap);
 #endif
 
+		if (info->si_code == SI_NOINFO)
+			panic("received signal %d with no info",
+			    info->si_signo);
+
 		va = (vaddr_t) info->si_addr;
 		va = trunc_page(va);
 
@@ -174,7 +178,7 @@
 
 		/* sanity */
 		if ((va < VM_MIN_ADDRESS) || (va >= VM_MAX_ADDRESS))
-			panic("peeing outside the box!");
+			panic("peeing outside the box! (va=%p)", (void *)va);
 
 		/* extra debug for now */
 		if (va == 0)

Reply via email to