]> Cypherpunks repositories - gostls13.git/commit
runtime: add test for systemstack frame pointer adjustment
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Wed, 26 Apr 2023 08:07:02 +0000 (10:07 +0200)
committerCherry Mui <cherryyz@google.com>
Wed, 3 May 2023 14:34:04 +0000 (14:34 +0000)
commit6dca1a29ab57576807d84485ff7d908d68e5c008
treeeb54119de2e20fe6acfd94c5ad5332c2c5cbde3d
parent0d347544cbca0f42b160424f6bc2458ebcc7b3fc
runtime: add test for systemstack frame pointer adjustment

Add TestSystemstackFramePointerAdjust as a regression test for CL
489015.

By turning stackPoisonCopy into a var instead of const and introducing
the ShrinkStackAndVerifyFramePointers() helper function, we are able to
trigger the exact combination of events that can crash traceEvent() if
systemstack restores a frame pointer that is pointing into the old
stack.

Updates #59692

Change-Id: I60fc6940638077e3b60a81d923b5f5b4f6d8a44c
Reviewed-on: https://go-review.googlesource.com/c/go/+/489115
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
src/runtime/export_test.go
src/runtime/stack.go
src/runtime/stack_test.go