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

PowerRegisterSuspendResumeNotification error on Azure App Services with go 1.13.7 #37149

Closed
kpfaulkner opened this issue Feb 10, 2020 · 11 comments · Fixed by goproxies/go#1
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows release-blocker
Milestone

Comments

@kpfaulkner
Copy link

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

Go version 1.13.7 (also with 1.13.6/5/4.. )   but works with 1.13

Does this issue reproduce with the latest release?

1.13.7 yes

Believe this might be related to issue 35447

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

Note, building is fine (details below are just from the compile machine). It's on Azure App Services where the error happens (runtime).

go env Output
$ go env
C:\Users\kenfa\projects\gorepo> go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\kenfa\AppData\Local\go-build
set GOENV=C:\Users\kenfa\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\kenfa\projects\gopath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\users\kenfa\packages\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\users\kenfa\packages\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
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=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\kenfa\AppData\Local\Temp\go-build929673298=/tmp/go-build -gno-record-gcc-switches

What did you do?

Running a binary (windows executable) in an Azure App Service generates the stack trace:

A simple repro can be achieved with:

package main

import "fmt"

func main() {
fmt.Printf("hello world\n")
}

What did you expect to see?

hello world

What did you see instead?

runtime: PowerRegisterSuspendResumeNotification failed with errno= 5
fatal error: runtime: PowerRegisterSuspendResumeNotification failure

runtime stack:
runtime.throw(0x4dbc9c, 0x37)
c:/users/kenfa/packages/go/src/runtime/panic.go:774 +0x79 fp=0x82fdd8 sp=0x82fda8 pc=0x42cf09
runtime.monitorSuspendResume()
c:/users/kenfa/packages/go/src/runtime/os_windows.go:307 +0x20a fp=0x82fe80 sp=0x82fdd8 pc=0x42992a
runtime.goenvs()
c:/users/kenfa/packages/go/src/runtime/os_windows.go:544 +0x1ba fp=0x82fed8 sp=0x82fe80 pc=0x42a2aa
runtime.schedinit()
c:/users/kenfa/packages/go/src/runtime/proc.go:554 +0xa9 fp=0x82ff30 sp=0x82fed8 pc=0x42f8f9
runtime.rt0_go(0x82ff60, 0x7fff2bc184d4, 0x82ff60, 0x0, 0x7fff2bc184d4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
c:/users/kenfa/packages/go/src/runtime/asm_amd64.s:214 +0x13d fp=0x82ff38 sp=0x82ff30 pc=0x452e5d

@networkimprov
Copy link

networkimprov commented Feb 10, 2020

@kpfaulkner, what are specifics of Azure App Services config?

This has appeared before in #35447 and #36557. It's caused by the fix for #31528.

@gopherbot add OS-Windows release-blocker
cc @zx2c4 @aclements @ianlancetaylor @jstarks

@kpfaulkner
Copy link
Author

@networkimprov In this case I simply made a free tier app service plan via the Azure Portal and made an empty app service within that. I can make up a set of powershell/az commands to do the same if it helps, but if using the UI it's literally app service plan -> windows ->

The quickest way to deploy in this case is just drag/drop the go-built exe file via the SCM web interface. I can provide screen shots with literal step-by-step if it helps.

@zx2c4
Copy link
Contributor

zx2c4 commented Feb 10, 2020

I'm pretty sure my original fix for this issue rather than the whack a mole as was requested by interlocuteurs is preferable.

If you want a hybrid, warn on new error codes, but don't bring down the entire runtime. The Linux kernel in recent years has adopted this policy too, preferring WARN_ON to BUG_ON.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 10, 2020
@networkimprov
Copy link

@gopherbot please backport. It's another instance of this regression...

@gopherbot
Copy link
Contributor

gopherbot commented Feb 14, 2020

Backport issue(s) opened: #37229 (for 1.12), #37230 (for 1.13), #37699 (for 1.14).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/219657 mentions this issue: runtime: ignore error returned by PowerRegisterSuspendResumeNotification

@alexbrainman
Copy link
Member

@kpfaulkner please see, if you can test this change

https://golang.org/cl/219657

I'm pretty sure my original fix for this issue rather than the whack a mole as was requested by interlocuteurs is preferable.

I agree. My approach did not work.

Alex

@dmitshur
Copy link
Contributor

dmitshur commented Mar 5, 2020

Friendly ping @kpfaulkner. Did you see the message @alexbrainman has posted above? Are you able to test CL 219657 and let us know if it fixes this issue for you? Thanks.

@kpfaulkner
Copy link
Author

Ah, didn't see that. Currently traveling. Will look at that in the next few days.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/224585 mentions this issue: [release-branch.go1.13] runtime: ignore error returned by PowerRegisterSuspendResumeNotification

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/224586 mentions this issue: [release-branch.go1.14] runtime: ignore error returned by PowerRegisterSuspendResumeNotification

gopherbot pushed a commit that referenced this issue Mar 25, 2020
…erSuspendResumeNotification

It appears that PowerRegisterSuspendResumeNotification is not supported
when running inside Docker - see issues #35447, #36557 and #37149.

Our current code relies on error number to determine Docker environment.
But we already saw PowerRegisterSuspendResumeNotification return
ERROR_FILE_NOT_FOUND, ERROR_INVALID_PARAMETERS and ERROR_ACCESS_DENIED
(see issues above). So this approach is not sustainable.

Just ignore PowerRegisterSuspendResumeNotification returned error.

For #37149
Fixes #37230

Change-Id: I2beba9d45cdb8c1efac5e974e747827a6261915a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219657
Run-TryBot: Alex Brainman <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Austin Clements <[email protected]>
Reviewed-by: Jason A. Donenfeld <[email protected]>
(cherry picked from commit d467f3b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/224585
Run-TryBot: Ian Lance Taylor <[email protected]>
gopherbot pushed a commit that referenced this issue Mar 25, 2020
…erSuspendResumeNotification

It appears that PowerRegisterSuspendResumeNotification is not supported
when running inside Docker - see issues #35447, #36557 and #37149.

Our current code relies on error number to determine Docker environment.
But we already saw PowerRegisterSuspendResumeNotification return
ERROR_FILE_NOT_FOUND, ERROR_INVALID_PARAMETERS and ERROR_ACCESS_DENIED
(see issues above). So this approach is not sustainable.

Just ignore PowerRegisterSuspendResumeNotification returned error.

For #37149
Fixes #37699

Change-Id: I2beba9d45cdb8c1efac5e974e747827a6261915a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219657
Run-TryBot: Alex Brainman <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Austin Clements <[email protected]>
Reviewed-by: Jason A. Donenfeld <[email protected]>
(cherry picked from commit d467f3b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/224586
Run-TryBot: Ian Lance Taylor <[email protected]>
@golang golang locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows release-blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants