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: hangs on windows with golang >= 1.14 #48059

Open
suikast42 opened this issue Aug 30, 2021 · 10 comments
Open

runtime: hangs on windows with golang >= 1.14 #48059

suikast42 opened this issue Aug 30, 2021 · 10 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@suikast42
Copy link

Does this issue reproduce with the latest release?

Yes.
Works with v <1.14. Last working version is 1.13.15

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

go env Output
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\IDE\Programme\go\cache
set GOENV=C:\IDE\Programme\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\IDE\Programme\go\path
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\IDE\Programme\go\go114
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\IDE\Programme\go\go114\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\IDE\Projects_Git\playground\go\examples\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 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\IDE\Programme\go\tmp\go-build087442934=/tmp/go-build -gno-record-gcc-switches

What did you do?

create a simple hello world program
hello

  • main
    • main.go

go run main.go runs every time as expected ( with go v 1.13.15)

But with go v > 1.14 it runs rarely. That means 99% of the cases it hangs.
After the hanging I can't interrupt the cmd window with Ctrl+C. So I must kill the cmd process. over the task manager.

I had an eye to the MCAfee Scanner. I let it deinstall from our IT-Department for testing. But the result was the same. Nothing changed.

Windows defender is disabled.

That's my output with the -x flag

go run -x main.go Output

C:\IDE\Projects_Git\playground\go\hello\main>go run -x main.go
WORK=C:\IDE\Programme\go\tmp\go-build432668794

After this output the run command hangs

What I have testet?

  1. Deinstall MCAfee
  2. Run command as Administrator
  3. Set all path variables to C:\IDE... ( this area is not touched from MCAfee )
  4. Testest not working versions 1.14 - 1.17
@D1CED
Copy link

D1CED commented Aug 30, 2021

This could be an issue with async preemtion of goroutines added in go1.14. Try running your binaries with GODEBUG=asyncpreemptoff=1 set.

@suikast42
Copy link
Author

This could be an issue with async preemtion of goroutines added in go1.14. Try running your binaries with GODEBUG=asyncpreemptoff=1 set.

That's works as expected.

I found out that's works as well if I set GOMAXPROCS=1. What is the better workaround for that issue?

@D1CED
Copy link

D1CED commented Aug 30, 2021

Hi, I suggest you to keep this issue open for the Go team to see. Async preemtion not working properly is for sure a bug (in the runtime or OS or somewhere else) and people should not be expected to fall back to workarounds.

@suikast42 suikast42 reopened this Aug 30, 2021
@suikast42
Copy link
Author

suikast42 commented Aug 30, 2021

and people should not be expected to fall back to workarounds.

Agree. My bad ;-)

@cherrymui cherrymui changed the title Build and clean hangs on windows with golang > 1.14 runtime: hangs on windows with golang >= 1.14 Aug 30, 2021
@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 30, 2021
@cherrymui cherrymui added this to the Backlog milestone Aug 30, 2021
@cherrymui
Copy link
Member

Maybe related to #36492.

@suikast42 Is it always hang or sometimes? Would it be possible for you to capture the program's state when it hangs?

cc @aclements @alexbrainman

@suikast42
Copy link
Author

suikast42 commented Aug 31, 2021

@suikast42 Is it always hang or sometimes?

cc @aclements @alexbrainman

Somtimes it works :-D

Would it be possible for you to capture the program's state when it hangs?

cc @aclements @alexbrainman

Sure. If you tell me how.

@alexbrainman
Copy link
Member

Maybe related to #36492.

It could well be the same. #36492 is still broken for me as you can see from #36492 (comment).

Sure. If you tell me how.

@suikast42 what I do is I use Process Explorer program to see what happens to the Go programs (like go.exe and compile.exe and link.exe) that build my program. See #36492 (comment) for a screenshot of what I see. If you see some of Go build tools processes start and never exit, then you would have the same problem.

You can get Process Explorer from https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

Alex

@suikast42
Copy link
Author

Here is a dump from Process Explorer. I hope that is what you mean.

go.zip

@alexbrainman
Copy link
Member

Here is a dump from Process Explorer. I hope that is what you mean.

go.zip

@suikast42 I did not expect you to collect Process Explorer process dump. I will let @cherrymui reply what he expected you to collect.

Thank you.

Alex

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@Durgababu
Copy link

Durgababu commented Mar 24, 2023

@mknyszek @cherrymui @alexbrainman
Any fix for this issue in go 1.19 or later versions. We are also experiencing the same hang issue once we migrated to 1.17. Earlier we were using go 1.13.9 and we didn't had this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
Status: Triage Backlog
Development

No branches or pull requests

6 participants