Skip to content

Commit c58417b

Browse files
committed
runtime: mark TestTracebackArgs test functions nosplit
The argument liveness tests expect outputs where a dead stack slot has a poisoned value. If the test function is preempted at the prologue, it will go with the morestack code path which will spill all the argument registers. Mark them nosplit to avoid that. Should fix #49354. Change-Id: I3b13e72e925748687a53c494bfaa70f07d9496fa Reviewed-on: https://go-review.googlesource.com/c/go/+/361211 Trust: Cherry Mui <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Austin Clements <[email protected]>
1 parent f249fa2 commit c58417b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/runtime/traceback_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ func testTracebackArgs8d(a testArgsType8d) int {
353353
return n
354354
}
355355

356+
// nosplit to avoid preemption or morestack spilling registers.
357+
//
358+
//go:nosplit
356359
//go:noinline
357360
func testTracebackArgs9(a int64, b int32, c int16, d int8, x [2]int, y int) int {
358361
if a < 0 {
@@ -366,15 +369,20 @@ func testTracebackArgs9(a int64, b int32, c int16, d int8, x [2]int, y int) int
366369
return n
367370
}
368371

372+
// nosplit to avoid preemption or morestack spilling registers.
373+
//
374+
//go:nosplit
369375
//go:noinline
370376
func testTracebackArgs10(a, b, c, d, e int32) int {
371377
// no use of any args
372378
return runtime.Stack(testTracebackArgsBuf[:], false)
373379
}
374380

375381
// norace to avoid race instrumentation changing spill locations.
382+
// nosplit to avoid preemption or morestack spilling registers.
376383
//
377384
//go:norace
385+
//go:nosplit
378386
//go:noinline
379387
func testTracebackArgs11a(a, b, c int32) int {
380388
if a < 0 {
@@ -387,8 +395,10 @@ func testTracebackArgs11a(a, b, c int32) int {
387395
}
388396

389397
// norace to avoid race instrumentation changing spill locations.
398+
// nosplit to avoid preemption or morestack spilling registers.
390399
//
391400
//go:norace
401+
//go:nosplit
392402
//go:noinline
393403
func testTracebackArgs11b(a, b, c, d int32) int {
394404
var x int32

0 commit comments

Comments
 (0)