From e470a00cdff2c4c13162dc8887fedd6812393514 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 1 Oct 2024 16:50:04 +0700 Subject: [PATCH] test: fix test issue 69434 for riscv64 CL 615915 simplified test for issue 69434, using gcflags maymorestack to force stack moving, making program failed with invalid stack pointer. However, it seems that this maymorestack is broken on riscv64. At least gotip-linux-riscv64 is currently broken. This CL fixes this problem by using the initial approach, growing stack size big enough to force stack moving. Updates #69434 Fixes #69714 Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64 Change-Id: I95255fba884a200f75bcda34d58e9717e4a952ad Reviewed-on: https://go-review.googlesource.com/c/go/+/616698 Reviewed-by: Keith Randall Auto-Submit: Cuong Manh Le LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- test/fixedbugs/issue69434.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/fixedbugs/issue69434.go b/test/fixedbugs/issue69434.go index 6443bde50f8..026d3246063 100644 --- a/test/fixedbugs/issue69434.go +++ b/test/fixedbugs/issue69434.go @@ -1,4 +1,4 @@ -// run -gcflags=-d=maymorestack=runtime.mayMoreStackMove +// run // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -13,6 +13,7 @@ import ( func All() iter.Seq[int] { return func(yield func(int) bool) { for i := 0; i < 10; i++ { + growStack(512) if !yield(i) { return } @@ -48,6 +49,13 @@ func f() { } } +func growStack(i int) { + if i == 0 { + return + } + growStack(i - 1) +} + func main() { f() }