runtime: handle fault during runtime more like unexpected fault address

Delaying the runtime.throw until here will print more information.
In particular it will print the signal and code values, which means
it will show the fault address.

The canpanic checks were added recently, in CL 75320043.
They were just not added in exactly the right place.

LGTM=iant
R=dvyukov, iant
CC=golang-codereviews
https://golang.org/cl/83980043
This commit is contained in:
Russ Cox 2014-04-03 19:05:59 -04:00
parent f5f5a8b620
commit 4110271501
15 changed files with 30 additions and 18 deletions

View file

@ -214,6 +214,9 @@ runtime·unminit(void)
void
runtime·sigpanic(void)
{
if(!runtime·canpanic(g))
runtime·throw("unexpected signal during runtime execution");
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {