mirror of
https://github.com/golang/go
synced 2024-11-22 01:04:40 -07:00
runtime: fix crash trace on amd64
g is not in r15 anymore. now it's in a per-thread memory segment, which is valid even inside a signal handler, so we can just refer to g directly. Fixes #1082. R=r CC=golang-dev https://golang.org/cl/2149045
This commit is contained in:
parent
0aa2317096
commit
befecf6b59
@ -112,8 +112,8 @@ sighandler(int32 sig, Siginfo *info, void *context)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if(gotraceback()){
|
if(gotraceback()){
|
||||||
traceback((void*)r->rip, (void*)r->rsp, 0, (void*)r->r15);
|
traceback((void*)r->rip, (void*)r->rsp, 0, g);
|
||||||
tracebackothers((void*)r->r15);
|
tracebackothers(g);
|
||||||
dumpregs(r);
|
dumpregs(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ sighandler(int32 sig, Siginfo* info, void* context)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if(gotraceback()){
|
if(gotraceback()){
|
||||||
traceback((void*)r->mc_rip, (void*)r->mc_rsp, 0, (void*)r->mc_r15);
|
traceback((void*)r->mc_rip, (void*)r->mc_rsp, 0, g);
|
||||||
tracebackothers((void*)r->mc_r15);
|
tracebackothers(g);
|
||||||
dumpregs(r);
|
dumpregs(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +105,8 @@ sighandler(int32 sig, Siginfo* info, void* context)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if(gotraceback()){
|
if(gotraceback()){
|
||||||
traceback((void*)r->rip, (void*)r->rsp, 0, (void*)r->r15);
|
traceback((void*)r->rip, (void*)r->rsp, 0, g);
|
||||||
tracebackothers((void*)r->r15);
|
tracebackothers(g);
|
||||||
dumpregs(r);
|
dumpregs(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user