From fb7f217fe76f46aedb9cd017c79412600c11f959 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 22 Mar 2013 17:32:04 -0700 Subject: [PATCH] runtime: correct misplaced right brace in Linux SIGBUS handling I'm not sure how to write a test for this. The change in behaviour is that if you somehow get a SIGBUS signal for an address >= 0x1000, the program will now crash rather than calling panic. As far as I know, on x86 GNU/Linux, the only way to get a SIGBUS (rather than a SIGSEGV) is to set the stack pointer to an invalid value. R=golang-dev, r CC=golang-dev https://golang.org/cl/7906045 --- src/pkg/runtime/os_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/runtime/os_linux.c b/src/pkg/runtime/os_linux.c index 8aa4c3d35d..e4ae1a5d80 100644 --- a/src/pkg/runtime/os_linux.c +++ b/src/pkg/runtime/os_linux.c @@ -225,8 +225,8 @@ runtime·sigpanic(void) if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000) { if(g->sigpc == 0) runtime·panicstring("call of nil func value"); - } runtime·panicstring("invalid memory address or nil pointer dereference"); + } runtime·printf("unexpected fault address %p\n", g->sigcode1); runtime·throw("fault"); case SIGSEGV: -- 2.50.0