]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.5] runtime: take stack barrier lock during copystack
authorAustin Clements <austin@google.com>
Mon, 23 Nov 2015 20:03:38 +0000 (15:03 -0500)
committerAustin Clements <austin@google.com>
Tue, 24 Nov 2015 02:18:46 +0000 (02:18 +0000)
commit6b26788c55d2c1e874e6321b8ce33f1a2c0270e6
treebbb481a6644c14a97c9a95a2fb6009a8e1174d01
parent9f9b95bb59176d4b9e381265ea49a8fe15a5f3c1
[release-branch.go1.5] 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>
Reviewed-on: https://go-review.googlesource.com/17194
src/runtime/stack1.go