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

runtime: M woken with no P on Windows #35391

Open
jazzy-crane opened this issue Nov 6, 2019 · 1 comment

Comments

@jazzy-crane
Copy link

@jazzy-crane jazzy-crane commented Nov 6, 2019

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

$ go version
go version go1.12.12 windows/amd64

Does this issue reproduce with the latest release?

Not a reproducible scenario unfortunately

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

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\ContainerAdministrator\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\gopath
set GOPROXY=
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-LC:/winsdklibs64
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ContainerAdministrator\AppData\Local\Temp\go-build221886546=/tmp/go-build -gno-record-gcc-switches

What did you do?

This was a one-off crash seen on our moderately large windows application written in Go. It occurred within a second of startup of the application - not immediately, many of our modules/packages successfully initialised.

fatal error: unexpected signal during runtime execution
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x43dae3]

runtime stack:
runtime.throw(0x1579f3c, 0x2a)
	c:/go/src/runtime/panic.go:617 +0x79
runtime.sigpanic()
	c:/go/src/runtime/signal_windows.go:227 +0x272
runtime.wirep(0x0)
	c:/go/src/runtime/proc.go:4111 +0x43
runtime.acquirep(0x0)
	c:/go/src/runtime/proc.go:4086 +0x32
runtime.stopm()
	c:/go/src/runtime/proc.go:1938 +0xf9
runtime.startlockedm(0xc000314600)
	c:/go/src/runtime/proc.go:2106 +0x91
runtime.schedule()
	c:/go/src/runtime/proc.go:2555 +0x77
runtime.park_m(0xc0005e4480)
	c:/go/src/runtime/proc.go:2605 +0xb6
runtime.mcall(0x2000)
	c:/go/src/runtime/asm_amd64.s:299 +0x5e

Apologies that I can't provide much information to narrow this down. I'm hoping the stacktrace alone is interesting - it looks to me that runtime.wirep shouldn't be called with a nil *p pointer. I suppose I can't rule out heap corruption, but we're not in the midst of seeing lots of one-off crashes in development.

What did you expect to see?

No runtime crash - application completes initialisation

What did you see instead?

Runtime crash midway through application initialisation

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 6, 2019

Thanks for the report. Unfortunately I just looked through every code path and I don't see how this is possible. My best guess is that somehow WaitForSingleObject returned before it was signaled. Or I suppose it is conceivable that there was no memory fence between the call to SetEvent and the return from WaitFromSingleObject, although that seems implausible.

This code has changed slightly on tip, but not in a way that I would expect to make a difference.

I guess we will keep this issue open and see if it happens again.

@ianlancetaylor ianlancetaylor changed the title "fatal error: unexpected signal during runtime execution" on windows/amd64 runtime: M woken with no P on Windows Nov 6, 2019
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.