aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/stack_test.go')
-rw-r--r--src/runtime/stack_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/runtime/stack_test.go b/src/runtime/stack_test.go
index 4e3f369f2f..042289aa58 100644
--- a/src/runtime/stack_test.go
+++ b/src/runtime/stack_test.go
@@ -939,3 +939,22 @@ func TestFramePointerAdjust(t *testing.T) {
t.Errorf("output:\n%s\n\nwant no output", output)
}
}
+
+// TestSystemstackFramePointerAdjust is a regression test for issue 59692 that
+// ensures that the frame pointer of systemstack is correctly adjusted. See CL
+// 489015 for more details.
+func TestSystemstackFramePointerAdjust(t *testing.T) {
+ growAndShrinkStack(512, [1024]byte{})
+}
+
+// growAndShrinkStack grows the stack of the current goroutine in order to
+// shrink it again and verify that all frame pointers on the new stack have
+// been correctly adjusted. stackBallast is used to ensure we're not depending
+// on the current heuristics of stack shrinking too much.
+func growAndShrinkStack(n int, stackBallast [1024]byte) {
+ if n <= 0 {
+ return
+ }
+ growAndShrinkStack(n-1, stackBallast)
+ ShrinkStackAndVerifyFramePointers()
+}