]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.12] runtime: scan defer closure in stack scan
authorCherry Zhang <cherryyz@google.com>
Wed, 27 Feb 2019 17:34:20 +0000 (12:34 -0500)
committerIan Lance Taylor <iant@golang.org>
Fri, 1 Mar 2019 18:39:38 +0000 (18:39 +0000)
commit91fd14b82493e592730a3e459ef6610195b854c2
tree2b77c9ed12b67fb250de7718f358a6ff2663adb0
parent162b3610e62f2e55e4048f2f72273a58e152236e
[release-branch.go1.12] runtime: scan defer closure in stack scan

With stack objects, when we scan the stack, it scans defers with
tracebackdefers, but it seems to me that tracebackdefers doesn't
include the func value itself, which could be a stack allocated
closure. Scan it explicitly.

Alternatively, we can change tracebackdefers to include the func
value, which in turn needs to change the type of stkframe.

Updates #30453.
Fixes #30470.

Change-Id: I55a6e43264d6952ab2fa5c638bebb89fdc410e2b
Reviewed-on: https://go-review.googlesource.com/c/164118
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 4f4c2a79d4f952b96d58aec2926b4c894245071b)
Reviewed-on: https://go-review.googlesource.com/c/164629
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/mgcmark.go
src/runtime/stack_test.go
src/runtime/testdata/testprog/gc.go