Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: nosplit stack overflow #45698

Closed
cuiweixie opened this issue Apr 22, 2021 · 2 comments
Closed

cmd/compile: nosplit stack overflow #45698

cuiweixie opened this issue Apr 22, 2021 · 2 comments
Labels
Milestone

Comments

@cuiweixie
Copy link
Contributor

@cuiweixie cuiweixie commented Apr 22, 2021

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

$ go version
go version devel go1.17-14a18b7d25 Thu Apr 22 04:07:38 2021 +0000 windows/amd64

Does this issue reproduce with the latest release?

No

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

go env Output
$ go env

$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\cuiweixie\AppData\Local\go-build
set GOENV=C:\Users\cuiweixie\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\code\go\gopath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\code\go\gopath
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\code\go\src\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\code\go\src\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.17-381252f312 Wed Apr 21 13:27:17 2021 +0000
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=D:\code\go\src\go\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\CUIWEI~1\AppData\Local\Temp\go-build1006093855=/tmp/go-build -gno-record-gcc-switches

What did you do?

CGO_ENABLED=0 go build -v -gcflags "all=-N -l" .

https://play.golang.org/p/JGuMjNxG6Ov

What did you expect to see?

success

What did you see instead?

failed
`
github.com/cuiweixie/go_compiler/code/basic/demo1

github.com/cuiweixie/go_compiler/code/basic/demo1

runtime.goPanicIndexU: nosplit stack overflow
792 assumed on entry to syscall.Syscall9<1> (nosplit)
672 after syscall.Syscall9<1> (nosplit) uses 120
664 on entry to syscall.Syscall9<0> (nosplit)
616 after syscall.Syscall9<0> (nosplit) uses 48
608 on entry to runtime.deferreturn<1> (nosplit)
544 after runtime.deferreturn<1> (nosplit) uses 64
536 on entry to runtime.freedefer<1> (nosplit)
408 after runtime.freedefer<1> (nosplit) uses 128
400 on entry to runtime.gcWriteBarrierR9<1> (nosplit)
392 on entry to runtime.gcWriteBarrier<1> (nosplit)
272 after runtime.gcWriteBarrier<1> (nosplit) uses 120
264 on entry to runtime.wbBufFlush<0> (nosplit)
240 after runtime.wbBufFlush<0> (nosplit) uses 24
232 on entry to runtime.wbBufFlush<1> (nosplit)
208 after runtime.wbBufFlush<1> (nosplit) uses 24
200 on entry to runtime.cgoCheckWriteBarrier<1> (nosplit)
160 after runtime.cgoCheckWriteBarrier<1> (nosplit) uses 40
152 on entry to runtime.cgoIsGoPointer<1> (nosplit)
88 after runtime.cgoIsGoPointer<1> (nosplit) uses 64
80 on entry to runtime.inHeapOrStack<1> (nosplit)
56 after runtime.inHeapOrStack<1> (nosplit) uses 24
48 on entry to runtime.spanOf<1> (nosplit)
8 after runtime.spanOf<1> (nosplit) uses 40
0 on entry to runtime.panicIndexU<1> (nosplit)
-8 on entry to runtime.goPanicIndexU<1>

`

@aarzilli
Copy link
Contributor

@aarzilli aarzilli commented Apr 23, 2021

Likely related:

$ go version
go version devel go1.17-5963f0a332 Fri Apr 23 05:38:47 2021 +0000 linux/amd64

cross-compiling https://github.com/go-delve/delve/tree/master/_fixtures/buildtest from linux to windows:

$ GOOS=windows go build -gcflags='all=-N -l'
# github.com/go-delve/delve/_fixtures/buildtest
runtime.goPanicIndexU: nosplit stack overflow
	792	assumed on entry to syscall.Syscall9<1> (nosplit)
	672	after syscall.Syscall9<1> (nosplit) uses 120
	664	on entry to syscall.Syscall9<0> (nosplit)
	616	after syscall.Syscall9<0> (nosplit) uses 48
	608	on entry to runtime.deferreturn<1> (nosplit)
	544	after runtime.deferreturn<1> (nosplit) uses 64
	536	on entry to runtime.freedefer<1> (nosplit)
	408	after runtime.freedefer<1> (nosplit) uses 128
	400	on entry to runtime.gcWriteBarrierR9<1> (nosplit)
	392	on entry to runtime.gcWriteBarrier<1> (nosplit)
	272	after runtime.gcWriteBarrier<1> (nosplit) uses 120
	264	on entry to runtime.wbBufFlush<0> (nosplit)
	240	after runtime.wbBufFlush<0> (nosplit) uses 24
	232	on entry to runtime.wbBufFlush<1> (nosplit)
	208	after runtime.wbBufFlush<1> (nosplit) uses 24
	200	on entry to runtime.cgoCheckWriteBarrier<1> (nosplit)
	160	after runtime.cgoCheckWriteBarrier<1> (nosplit) uses 40
	152	on entry to runtime.cgoIsGoPointer<1> (nosplit)
	88	after runtime.cgoIsGoPointer<1> (nosplit) uses 64
	80	on entry to runtime.inHeapOrStack<1> (nosplit)
	56	after runtime.inHeapOrStack<1> (nosplit) uses 24
	48	on entry to runtime.spanOf<1> (nosplit)
	8	after runtime.spanOf<1> (nosplit) uses 40
	0	on entry to runtime.panicIndexU<1> (nosplit)
	-8	on entry to runtime.goPanicIndexU<1>
@cherrymui cherrymui added this to the Go1.17 milestone Apr 26, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented May 3, 2021

Change https://golang.org/cl/316650 mentions this issue: runtime: call unlockOSThread directly in Windows syscall functions

@gopherbot gopherbot closed this in 4dbad79 May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants