go icon indicating copy to clipboard operation
go copied to clipboard

cmd/compile: nosplit stack overflow with -gcflags "all=-N -l" -race (darwin/arm64 | Goland debug cmd)

Open ghostiam opened this issue 3 years ago • 10 comments

What version of Go are you using (go version)?

$ go version
go version go1.18.5 darwin/arm64

Does this issue reproduce with the latest release?

Yes (go 1.19)

$ go version
go version go1.19 darwin/arm64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/ghostiam/Library/Caches/go-build"
GOENV="/Users/ghostiam/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/ghostiam/projects/golang/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ghostiam/projects/golang"
GOPRIVATE=""
GOPROXY="http://localhost:8123"
GOROOT="/Users/ghostiam/projects/golang/sdk/go1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/ghostiam/projects/golang/sdk/go1.19/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ghostiam/Desktop/test/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pc/st46ghc9375gx_q1ktbvpq900000gn/T/go-build1017110940=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go build -gcflags "all=-N -l" -race -v

2 lines of code: https://go.dev/play/p/v-LC84qDHo4

package main

import (
	"os/exec"
)

func main() {
	cmd := exec.Command("echo", "test")
	_ = cmd.Start()
}

What did you expect to see?

Successful build and debug

What did you see instead?

go 1.18.5 Output
$ go build  -gcflags "all=-N -l" -race -v
test
# test
runtime.fatalthrow: nosplit stack overflow
	792	assumed on entry to syscall.ptrace (nosplit)
	664	after syscall.ptrace (nosplit) uses 128
	456	after syscall.ptrace1 (nosplit) uses 208
	264	after syscall.syscall6 (nosplit) uses 192
	232	after runtime.entersyscall (nosplit) uses 32
	168	after runtime.reentersyscall (nosplit) uses 64
	136	after runtime.save (nosplit) uses 32
	104	after runtime.badctxt (nosplit) uses 32
	56	after runtime.throw (nosplit) uses 48
	-8	after runtime.fatalthrow (nosplit) uses 64
go 1.19 Output
$ go build  -gcflags "all=-N -l" -race -v
unicode/utf8
math/bits
internal/itoa
internal/unsafeheader
internal/goos
internal/goarch
unicode
internal/goexperiment
runtime/internal/math
runtime/internal/sys
internal/abi
sync/atomic
internal/cpu
math
runtime/internal/atomic
internal/bytealg
runtime
internal/reflectlite
internal/race
sync
internal/testlog
errors
sort
internal/oserror
path
io
strconv
syscall
bytes
strings
internal/syscall/execenv
internal/syscall/unix
time
runtime/cgo
context
io/fs
internal/poll
os
internal/godebug
path/filepath
os/exec
runtime/race
test
# test
syscall.ptrace: nosplit stack over 792 byte limit
syscall.ptrace
    grows 128 bytes, calls syscall.ptrace1
        grows 208 bytes, calls syscall.syscall6
            grows 192 bytes, calls runtime.entersyscall
                grows 32 bytes, calls runtime.reentersyscall
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.abort
                                        24 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                    grows 64 bytes, calls runtime.casgstatus
                        grows 80 bytes, calls runtime.nanotime
                            grows 32 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    56 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                        grows 80 bytes, calls runtime.nanotime
                            grows 32 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    56 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                        grows 80 bytes, calls runtime.osyield
                            grows 32 bytes, calls runtime.usleep
                                grows 32 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    40 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            56 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        56 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            56 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        56 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            56 bytes over limit
                        grows 80 bytes, calls runtime.nanotime
                            grows 32 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    56 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                        grows 80 bytes, calls runtime.nanotime
                            grows 32 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    56 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                        grows 80 bytes, calls runtime.nanotime
                            grows 32 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    56 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        72 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            72 bytes over limit
                        grows 80 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.abort
                                    40 bytes over limit
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.abort
                                        24 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.abort
                                        24 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.abort
                                        24 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.abort
                                        24 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch
                                            grows 0 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 16 bytes, calls runtime.save_g
                                        24 bytes over limit
            grows 192 bytes, calls runtime.exitsyscall
                grows 64 bytes, calls runtime.exitsyscallfast
                    grows 80 bytes, calls runtime.wirep
                        grows 64 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.systemstack
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.abort
                                8 bytes over limit
                                grows 16 bytes, calls gosave_systemstack_switch
                                    grows 0 bytes, calls runtime.abort
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.abort
                                    72 bytes over limit
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    72 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    72 bytes over limit
                        grows 64 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.systemstack
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.abort
                                8 bytes over limit
                                grows 16 bytes, calls gosave_systemstack_switch
                                    grows 0 bytes, calls runtime.abort
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.abort
                                    72 bytes over limit
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    72 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        72 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    72 bytes over limit
                grows 64 bytes, calls runtime.casgstatus
                    grows 80 bytes, calls runtime.nanotime
                        grows 32 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                24 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                    grows 80 bytes, calls runtime.nanotime
                        grows 32 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                24 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                    grows 80 bytes, calls runtime.osyield
                        grows 32 bytes, calls runtime.usleep
                            grows 32 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                8 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        24 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    24 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        24 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    24 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        24 bytes over limit
                    grows 80 bytes, calls runtime.nanotime
                        grows 32 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                24 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                    grows 80 bytes, calls runtime.nanotime
                        grows 32 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                24 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                    grows 80 bytes, calls runtime.nanotime
                        grows 32 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.(*guintptr).set
                                24 bytes over limit
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 16 bytes, calls gosave_systemstack_switch
                                        grows 0 bytes, calls runtime.abort
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                                    grows 16 bytes, calls runtime.save_g
                                    40 bytes over limit
                                    grows 16 bytes, calls indirect
                                        grows 0 bytes, calls runtime.morestack
                                        40 bytes over limit
                    grows 80 bytes, calls runtime.throw
                        grows 48 bytes, calls runtime.fatalthrow
                            grows 64 bytes, calls runtime.systemstack
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.abort
                                8 bytes over limit
                                grows 16 bytes, calls gosave_systemstack_switch
                                    grows 0 bytes, calls runtime.abort
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit
                                grows 16 bytes, calls indirect
                                    grows 0 bytes, calls runtime.morestack
                                    8 bytes over limit
                                grows 16 bytes, calls runtime.save_g
                                8 bytes over limit

Without -race everything compiles fine.

ghostiam avatar Aug 05 '22 11:08 ghostiam

go1.18.4 darwin/arm64 and go1.18.3 darwin/arm64 - compiles without error

ghostiam avatar Aug 05 '22 11:08 ghostiam

I can reproduce it stably now. (go version go1.19 darwin/amd64)

Output
syscall.ptrace: nosplit stack over 792 byte limit
syscall.ptrace
    grows 120 bytes, calls syscall.ptrace1
        grows 200 bytes, calls syscall.syscall6
            grows 192 bytes, calls runtime.entersyscall
                grows 32 bytes, calls runtime.reentersyscall
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                    grows 64 bytes, calls runtime.casgstatus
                        grows 72 bytes, calls runtime.nanotime
                            grows 24 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    24 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                        grows 72 bytes, calls runtime.nanotime
                            grows 24 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    24 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                        grows 72 bytes, calls runtime.osyield
                            grows 24 bytes, calls runtime.usleep
                                grows 32 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    8 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            24 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            24 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            24 bytes over limit
                        grows 72 bytes, calls runtime.nanotime
                            grows 24 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    24 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                        grows 72 bytes, calls runtime.nanotime
                            grows 24 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    24 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                        grows 72 bytes, calls runtime.nanotime
                            grows 24 bytes, calls runtime.nanotime1
                                grows 48 bytes, calls runtime.libcCall
                                    grows 64 bytes, calls runtime.(*guintptr).set
                                    24 bytes over limit
                                    grows 64 bytes, calls runtime.asmcgocall
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            40 bytes over limit
                        grows 72 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        16 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        16 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        16 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                    grows 64 bytes, calls runtime.save
                        grows 32 bytes, calls runtime.badctxt
                            grows 32 bytes, calls runtime.throw
                                grows 48 bytes, calls runtime.fatalthrow
                                    grows 64 bytes, calls runtime.systemstack
                                        grows 8 bytes, calls gosave_systemstack_switch
                                            grows 8 bytes, calls runtime.abort
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack
                                            8 bytes over limit
            grows 192 bytes, calls runtime.exitsyscall
                grows 64 bytes, calls runtime.exitsyscallfast
                    grows 72 bytes, calls runtime.wirep
                        grows 64 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        48 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        48 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        48 bytes over limit
                        grows 64 bytes, calls runtime.throw
                            grows 48 bytes, calls runtime.fatalthrow
                                grows 64 bytes, calls runtime.systemstack
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        48 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        48 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        48 bytes over limit
                grows 64 bytes, calls runtime.casgstatus
                    grows 72 bytes, calls runtime.nanotime
                        grows 24 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                    grows 72 bytes, calls runtime.nanotime
                        grows 24 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                    grows 72 bytes, calls runtime.nanotime
                        grows 24 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                    grows 72 bytes, calls runtime.nanotime
                        grows 24 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                    grows 72 bytes, calls runtime.nanotime
                        grows 24 bytes, calls runtime.nanotime1
                            grows 48 bytes, calls runtime.libcCall
                                grows 64 bytes, calls runtime.asmcgocall
                                    grows 8 bytes, calls gosave_systemstack_switch
                                        grows 8 bytes, calls runtime.abort
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack
                                        8 bytes over limit

hopehook avatar Aug 05 '22 12:08 hopehook

CC @aclements

hopehook avatar Aug 05 '22 13:08 hopehook

Change https://go.dev/cl/421954 mentions this issue: syscall: fix sycall.ptrace cause nosplit stack over 792 byte limit

gopherbot avatar Aug 07 '22 02:08 gopherbot

Confirmed in 1.19 version in M1 macs

sh0umik avatar Aug 07 '22 09:08 sh0umik

Why is this case important? The only reason to use -all=N -l is for debugging. Why is it necessary to debug code compiled with -race?

ianlancetaylor avatar Aug 07 '22 15:08 ianlancetaylor

Why is this case important? The only reason to use -all=N -l is for debugging. Why is it necessary to debug code compiled with -race? the -"all=-N -l" is added by Goland 's debugger auto, some time may need to debug with race like some go test -v -race report a issue. I will do this sometimes.
@ghostiam please tell us your scene!

cuiweixie avatar Aug 07 '22 15:08 cuiweixie

package main

import (
	"os/exec"
	"testing"
)

func TestA(t *testing.T) {
	cmd := exec.Command("echo", "test")
	_ = cmd.Start()
} 

below is Goland debug setting image as you can see debug with race must has "-N -l" setting, you even can not remove it click with debug image

@ianlancetaylor

cuiweixie avatar Aug 07 '22 15:08 cuiweixie

debug with race to fix sync issues is quite usually for Gland users like me!

cuiweixie avatar Aug 07 '22 15:08 cuiweixie

@ghostiam please tell us your scene!

I also have "-race" added to all projects that I develop by default so that I can always get race information. I don't feel comfortable removing "-race" when I need to debug. Everything worked correctly before, why shouldn't it work now?

ghostiam avatar Aug 07 '22 16:08 ghostiam

I'm not certain what we're going to do about this as this isn't necessarily a supported build configuration (AFAICT).

@cuonglm filed an upstream bug with Goland: https://youtrack.jetbrains.com/issue/GO-13486/Show-warning-when-debug-is-started-with-the-race-option. Assigning this @cuonglm for now. (Feel free to unassign! This is non-binding, just for triage. :))

mknyszek avatar Aug 10 '22 19:08 mknyszek

@mknyszek in VSCode (with vscode-golang), the settings used when running/building tests are the same for running tests and debugging tests, and there is no easy way to pass settings just for debugging or just for testing. This problem affects my company because we want to always enable the race detector when running tests, so we ship a shared config that sets

"go.testFlags": ["-race"]

Unfortunately, this bug means that when we upgraded to 1.19, we can no longer use the debugger in vscode through vscode-golang, since it automatically includes the test flags when building the debug binary. This works just fine in 1.18, but breaks in 1.19, so we've since downgraded to 1.18.

I don't know the best way to fix this; it's possible that in vscode-go (and i guess in other editors like Goland, as reported above) it could be solved by making it possible to pass flags "just when running tests" and "just when debugging tests". But that means every editor / setup needs to support that, and in general, encouraging your debug/testing/building code to special-case certain paths leads to increased chance of divergence and unexpected problems.

I think that this should be considered a supported build configuration because ~i'm using it~ it's likely that many VSCode users would like to use the race detector by default, and also want to be able to debug their tests. I cannot prove this though!

peterldowns avatar Sep 12 '22 22:09 peterldowns

same issue with VSCode & golang1.19.1 .

lsytj0413 avatar Oct 12 '22 06:10 lsytj0413

I'm still having this issue on go version go1.19.3 darwin/arm64 even without -race enabled. I'm getting this error because of an upstream dependency on gvisor. Running go build with flags -gcflags all=-N -l.

gvisor.dev/gvisor/pkg/refs.(*AtomicRefCount).DecRef: nosplit stack over 792 byte limit

clarkmcc avatar Nov 15 '22 22:11 clarkmcc

Alrighty, this is affecting quite a few people. Unassigning so it goes back in the triage queue.

mknyszek avatar Nov 15 '22 23:11 mknyszek

To be clear, I'm not saying that we're necessarily going to make this a supported build configuration, but we should figure out what we're going to do.

@clarkmcc Unfortunately, that case seems gVisor-specific. They use //go:nosplit directly which is not backed by the Go 1 backwards compatibility guarantee outside the standard library (https://groups.google.com/g/golang-nuts/c/Tq3cFNlg7ac/m/okpXURdiAgAJ). (We wouldn't pull the rug out from everyone using //go:nosplit without a warning, but it is technically an implementation detail and the Go runtime's implementation may change.) I think it's up to them if they support the -gcflags all=-N -l configuration.

This is different from OP's error because that's a break in standard library usage (for a technically unsupported configuration, but one that is apparently difficult for many to work around at this point in time).

mknyszek avatar Nov 15 '22 23:11 mknyszek

There's discussion in #51256 that's relevant to fixing these nosplit stack overflow issues at a deeper level, though we probably want a shorter-term fix for this.

aclements avatar Nov 16 '22 20:11 aclements

The discussed fix on our side is to increase the stack guard for -race builds. We might be able to do this in objabi.stackGuardMultiplier, since -race applies to the whole build anyway (stackGuardMultiplier can go sideways can be different for different packages in a build).

aclements avatar Nov 16 '22 20:11 aclements

Change https://go.dev/cl/451217 mentions this issue: runtime,cmd/link: increase stack guard space when building with -race

gopherbot avatar Nov 16 '22 21:11 gopherbot

Is there an interim workaround for this problem in GoLand on mac M1? I'm unable to debug one project... (I also see this using go version go1.20rc1 darwin/arm64)

rfay avatar Dec 30 '22 16:12 rfay

@rfay This should be fixed in go1.20rc1. If it isn't, please provide a stack trace or reproduction details so we can take a look.

randall77 avatar Dec 30 '22 17:12 randall77

Compile time Stack trace, go1.20rc1 arm64 from goland (debugging) GOROOT=/usr/local/go #gosetup GOPATH=/Users/rfay/go #gosetup /usr/local/go/bin/go build -o /private/var/folders/3k/0159p4ld73jfbct7ykph9w340000gn/T/GoLand/___1colima_start -gcflags all=-N -l github.com/abiosoft/colima/cmd/colima #gosetup # github.com/abiosoft/colima/cmd/colima gvisor.dev/gvisor/pkg/refs.(*AtomicRefCount).DecRef: nosplit stack over 792 byte limit gvisor.dev/gvisor/pkg/refs.(*AtomicRefCount).DecRef grows 48 bytes, calls gvisor.dev/gvisor/pkg/refs.(*AtomicRefCount).DecRefWithDestructor grows 144 bytes, calls gvisor.dev/gvisor/pkg/refs.(*weakRefList).Remove grows 112 bytes, calls gvisor.dev/gvisor/pkg/refs.(*weakRefEntry).SetNext grows 16 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 112 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 112 bytes, calls gvisor.dev/gvisor/pkg/refs.(*weakRefEntry).SetPrev grows 16 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 112 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 8 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 8 bytes over limit grows 112 bytes, calls gvisor.dev/gvisor/pkg/refs.(*weakRefEntry).SetNext grows 16 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 112 bytes, calls gvisor.dev/gvisor/pkg/refs.(*weakRefEntry).SetPrev grows 16 bytes, calls runtime.gcWriteBarrier grows 224 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.wbBufFlush grows 32 bytes, calls runtime.cgoCheckWriteBarrier grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit grows 48 bytes, calls runtime.cgoIsGoPointer grows 80 bytes, calls runtime.inHeapOrStack grows 32 bytes, calls runtime.spanOf grows 48 bytes, calls runtime.arenaIndex 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l1 24 bytes over limit grows 48 bytes, calls runtime.arenaIdx.l2 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 48 bytes, calls runtime.panicIndexU grows 0 bytes, calls runtime.goPanicIndexU grows 0 bytes, calls runtime.morestack 24 bytes over limit grows 32 bytes, calls runtime.(*mSpanStateBox).get grows 32 bytes, calls runtime/internal/atomic.(*Uint8).Load 8 bytes over limit

Compilation finished with exit code 1

rfay avatar Dec 30 '22 17:12 rfay

That looks like there are nosplit directives in user code, which isn't supported. Specifically, in gvisor.dev/gvisor/pkg/refs. But looking at https://pkg.go.dev/gvisor.dev/gvisor/pkg/refs, I don't see that code, or even those types. Where does that code come from?

randall77 avatar Dec 30 '22 17:12 randall77

Code is https://github.com/abiosoft/colima, thanks for listening!

rfay avatar Dec 30 '22 17:12 rfay

But where is it getting the code for, e.g., gvisor.dev/gvisor/pkg/refs.(*AtomicRefCount).DecRefWithDestructor?

randall77 avatar Dec 30 '22 17:12 randall77

  • gvisor uses a phantom setup for go get, https://github.com/google/gvisor#using-go-get
  • go get -u gvisor.dev/gvisor/runsc@go and then
  • go get -u ./... && go mod vendor

Seem to solve this, even for go 1.19.4

References:

  • gvisor using go get
  • https://github.com/google/gvisor/issues/8237
  • https://github.com/google/gvisor/issues/8149

I was just trying to do a PR to colima :) I guess I'll do a first PR with a vendor upgrade.

rfay avatar Dec 30 '22 18:12 rfay

Hi all, still having the same problem on my intel mac.

golang version is 1.19.5

zwjzxh520 avatar Jan 13 '23 02:01 zwjzxh520

@zwjzxh520 Can you try 1.20rc3? This issue should be fixed there.

randall77 avatar Jan 13 '23 03:01 randall77

Leaving this here in case it helps someone:

  1. Vendor dependencies
$ go mod vendor
  1. In vendor/gvisor.dev/gvisor/pkg/refs/refcounter.go, delete the line with the //go:nosplit directive

anukul avatar Feb 03 '23 14:02 anukul

The 1.20 release fixes this for me.

brackendawson avatar Feb 03 '23 14:02 brackendawson