]> Cypherpunks repositories - gostls13.git/commit
runtime: take stack barrier lock during copystack
authorAustin Clements <austin@google.com>
Mon, 23 Nov 2015 20:03:38 +0000 (15:03 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 24 Nov 2015 01:50:52 +0000 (01:50 +0000)
commitecf388f3a4dda0ffb1b11f65d2f5d703e7e4133f
tree91107a0af32b9efe941b9dce2f614236bc6af546
parentab4c9298b8185a056ff1152f2c7bd9b38d3d06f3
runtime: take stack barrier lock during copystack

Commit bbd1a1c prevented SIGPROF from scanning stacks that were being
copied, but it didn't prevent a stack copy (specifically a stack
shrink) from happening while SIGPROF is scanning the stack. As a
result, a stack copy may adjust stack barriers while SIGPROF is in the
middle of scanning a stack, causing SIGPROF to panic when it detects
an inconsistent stack barrier.

Fix this by taking the stack barrier lock while adjusting the stack.
In addition to preventing SIGPROF from scanning this stack, this will
block until any in-progress SIGPROF is done scanning the stack.

For 1.5.2.

Fixes #13362.
Updates #12932.

Change-Id: I422219c363054410dfa56381f7b917e04690e5dd
Reviewed-on: https://go-review.googlesource.com/17191
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/stack.go