Skip to content

cmd/compile: syscall.Syscall15: nosplit stack over 792 byte limit #69813

@nicolasparada

Description

@nicolasparada

Go version

go version go1.23.2 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/nicolasparada/Library/Caches/go-build'
GOENV='/Users/nicolasparada/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/nicolasparada/go/pkg/mod'
GONOPROXY='github.com/chronosphereio'
GONOSUMDB='github.com/chronosphereio'
GOOS='darwin'
GOPATH='/Users/nicolasparada/go'
GOPRIVATE='github.com/chronosphereio'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.23.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/nicolasparada/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='redacted/modules/cli/go.mod'
GOWORK='redacted/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/q5/y_70l5z562s_jnbc0yhcwfww0000gn/T/go-build4129866876=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Run the following command to compile our program:

go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -l -B"

This is run inside goreleaser for all the major platforms.

What did you see happen?

Got the following message when building for windows/arm64 (GOOS=windows GOARCH=arm64).

$ GOOS=windows GOARCH=arm64 go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -l -B"

syscall.Syscall15: nosplit stack over 792 byte limit
syscall.Syscall15<1>
    grows 288 bytes, calls syscall.SyscallN<1>
        grows 48 bytes, calls runtime.cgocall<1>
            grows 112 bytes, calls runtime.entersyscall<1>
                grows 48 bytes, calls runtime.reentersyscall<1>
                    grows 112 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.abort<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch<79>
                                            grows 0 bytes, calls runtime.abort<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                    grows 112 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.abort<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch<79>
                                            grows 0 bytes, calls runtime.abort<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                    grows 112 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.abort<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch<79>
                                            grows 0 bytes, calls runtime.abort<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                    grows 112 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.abort<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch<79>
                                            grows 0 bytes, calls runtime.abort<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                    grows 112 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.abort<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls gosave_systemstack_switch<79>
                                            grows 0 bytes, calls runtime.abort<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit
                                        grows 16 bytes, calls indirect
                                            grows 0 bytes, calls runtime.morestack<0>
                                            8 bytes over limit
                                        grows 16 bytes, calls runtime.save_g<0>
                                        8 bytes over limit

What did you expect to see?

I expect no error, this was working fine before upgrading to Go 1.23.
Noticed that removing the -l flag from -gcflags does the trick and makes the program to compile no issues:

GOOS=windows GOARCH=arm64 go build -o cli -trimpath -ldflags "-s -w" -gcflags "all=-C -B"

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.OS-Windows

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions