mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
f5f5a8b620
commit
4110271501
15 changed files with 30 additions and 18 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue