]> Cypherpunks repositories - gostls13.git/commit
runtime: make continuation pc available to stack walk
authorRuss Cox <rsc@golang.org>
Sat, 31 May 2014 14:10:12 +0000 (10:10 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 31 May 2014 14:10:12 +0000 (10:10 -0400)
commit14d2ee1d00b4fcaef569a84cb84888603405ca31
treef519d33ed7365cda86ba3cfb81a708d36d023857
parente56dc9966504405ecdad49f54edb45859ab3fa91
runtime: make continuation pc available to stack walk

The 'continuation pc' is where the frame will continue
execution, if anywhere. For a frame that stopped execution
due to a CALL instruction, the continuation pc is immediately
after the CALL. But for a frame that stopped execution due to
a fault, the continuation pc is the pc after the most recent CALL
to deferproc in that frame, or else 0. That is where execution
will continue, if anywhere.

The liveness information is only recorded for CALL instructions.
This change makes sure that we never look for liveness information
except for CALL instructions.

Using a valid PC fixes crashes when a garbage collection or
stack copying tries to process a stack frame that has faulted.

Record continuation pc in heapdump (format change).

Fixes #8048.

LGTM=iant, khr
R=khr, iant, dvyukov
CC=golang-codereviews, r
https://golang.org/cl/100870044
src/pkg/runtime/cgocall.c
src/pkg/runtime/heapdump.c
src/pkg/runtime/mgc0.c
src/pkg/runtime/panic.c
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h
src/pkg/runtime/stack.c
src/pkg/runtime/traceback_arm.c
src/pkg/runtime/traceback_x86.c
test/fixedbugs/issue8048.go [new file with mode: 0644]