Skip to content

Commit 3cad25e

Browse files
committed
runtime: Fix panic if newstack at runtime.acquireLockRank
The function named `acquireLockRank` at `src/runtime/lockrank_on.go` with `go:nosplit`, but at `src/runtime/lockrank_off.go` without `go:nosplit`. GOEXPERIMENT="" in default, process will panic if newstack at runtime.acquireLockRank with `gcflags="all=-N -l"`. Similarly, function `lockWithRank`, `unlockWithRank`, `releaseLockRank` and `lockWithRankMayAcquire`. Fixes #40843
1 parent 7148abc commit 3cad25e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/runtime/lockrank_off.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,24 @@ func getLockRank(l *mutex) lockRank {
1818
return 0
1919
}
2020

21+
//go:nosplit
2122
func lockWithRank(l *mutex, rank lockRank) {
2223
lock2(l)
2324
}
2425

26+
//go:nosplit
2527
func acquireLockRank(rank lockRank) {
2628
}
2729

30+
//go:nosplit
2831
func unlockWithRank(l *mutex) {
2932
unlock2(l)
3033
}
3134

35+
//go:nosplit
3236
func releaseLockRank(rank lockRank) {
3337
}
3438

39+
//go:nosplit
3540
func lockWithRankMayAcquire(l *mutex, rank lockRank) {
3641
}

0 commit comments

Comments
 (0)