go/src/cmd/internal
Keith Randall 9dac0a8132 runtime: on a signal, set traceback address to a deferreturn call
When a function triggers a signal (like a segfault which translates to
a nil pointer exception) during execution, a sigpanic handler is just
below it on the stack.  The function itself did not stop at a
safepoint, so we have to figure out what safepoint we should use to
scan its stack frame.

Previously we used the site of the most recent defer to get the live
variables at the signal site. That answer is not quite correct, as
explained in #27518. Instead, use the site of a deferreturn call.
It has all the right variables marked as live (no args, all the return
values, except those that escape to the heap, in which case the
corresponding PAUTOHEAP variables will be live instead).

This CL requires stack objects, so that all the local variables
and args referenced by the deferred closures keep the right variables alive.

Fixes #27518

Change-Id: Id45d8a8666759986c203181090b962e2981e48ca
Reviewed-on: https://go-review.googlesource.com/c/134637
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-10-03 19:54:23 +00:00
..
bio cmd/compile: add indexed export format 2018-04-24 01:05:27 +00:00
browser cmd/internal/browser: fix typo 2017-02-24 20:49:10 +00:00
buildid cmd/internal/buildid: close ELF file after reading note 2018-07-16 23:37:14 +00:00
dwarf cmd/link: move DIE of global variables to their compile unit 2018-09-27 11:58:35 +00:00
edit cmd/cover: modify source as text, not as AST 2017-11-13 14:59:26 +00:00
gcprog
goobj all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
obj cmd/compile,runtime: implement stack objects 2018-10-03 19:52:49 +00:00
objabi runtime: on a signal, set traceback address to a deferreturn call 2018-10-03 19:54:23 +00:00
objfile cmd/link: support windows/arm 2018-08-21 22:11:05 +00:00
src cmd/compile: plumb prologueEnd into DWARF 2018-05-14 14:12:31 +00:00
sys cmd/compile: only support -race and -msan where they work 2018-08-21 03:38:27 +00:00
test2json cmd/go: revert "output coverage report even if there are no test files" 2018-07-09 14:42:21 +00:00