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

Go test/generate/get running endlessly #43192

Closed
tiloKo opened this issue Dec 15, 2020 · 11 comments
Closed

Go test/generate/get running endlessly #43192

tiloKo opened this issue Dec 15, 2020 · 11 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@tiloKo
Copy link

tiloKo commented Dec 15, 2020

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

$ go version
go version go1.15.6 windows/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=C:\Users\xxx\go\bin
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOENV=C:\Users\xxx\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\xxx\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\xxx\go;C:\Users\xxx\git;
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\xxx\git\piper_CL\jenkins-library\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:\Users\xxx\AppData\Local\Temp\go-build997310438=/tmp/go-build -gno-record-gcc-switches
GOROOT/bin/go version: go version go1.15.6 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.15.6

What did you do?

go test in a folder not related to go does just output: package .: no Go files in


go test in a folder with go files just runs endlessly

same with go generate

same with go get

windows task manager -> "Analyze Wait chain" -> Displays go.exe is waithing for some of iths own threads endlessly

What did you expect to see?

something, at least an error message

What did you see instead?

nothing - it just runs endless

@mvdan
Copy link
Member

mvdan commented Dec 15, 2020

This isn't enough information to figure out what's going on. Please provide a way to reproduce the hang.

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 15, 2020
@tiloKo
Copy link
Author

tiloKo commented Dec 16, 2020

I have this issue on my business computer - I tried to reproduce on my private PC but there everything works as expected. I try to investigate with our IT department what has changed and might have caused this.

Anyway could you point me to some information how I can analyze this in more detail? Is there a way that go itself is writing trace files or how I can obtain any other information about it? go test -trace does not write anything as it is the runtime which hangs, not my tests.

@mvdan
Copy link
Member

mvdan commented Dec 16, 2020

you could try go test -x -v and run as few tests as possible, reducing the problem to as small an input as you can.

@tiloKo
Copy link
Author

tiloKo commented Dec 16, 2020

sorry for my limited capability to express the problem:
it is not the unit tests which hang, it is go itself. and it is not only go test but several go sub commands which hang. Other concrete example:
go get golang.org/x/tools/gopls@latest
just does nothing, for hours, no output, just running and waiting for something which is not happening...

@mvdan
Copy link
Member

mvdan commented Dec 16, 2020

If many go commands hang forever, that sounds like something is very wrong at a low level, perhaps with the system. Maybe try using a tool like strace to investigate what the processes are doing right up to when they get stuck, or sending SIGQUIT to get a stack trace dump of all goroutines.

cc @ianlancetaylor in case he has other ideas, but I still think this issue needs to be labelled WaitingForInfo because I don't see any actionable bug.

@randall77
Copy link
Contributor

If you can, try disabling your antivirus and see if that helps.

@tiloKo
Copy link
Author

tiloKo commented Dec 17, 2020

  • Unfortunately I cannot disable the antivirus on my business laptop - IT is analyzing the Anti virus Logs but did not came back to me...

  • I downloaded ProcessMonitor and when executing "go get golang.org/x/tools/gopls@latest" the last "real" activity shown is reading a lot of *.mod files in <user_dir>\go\pkg\mod\cache\download* after this only Thread Create, Thread Exit - every some seconds for about a dozen of threads...

  • I created a process dump of go.exe from task manager and executed the "CrashHang" analysis of DebugDiag but it also just says it did not find any common issue and lists 19 Threads all waiting:

ntdll!NtWaitForSingleObject+14  
KERNELBASE!WaitForSingleObjectEx+93  
go+6d19e

only thread shown there which looks a little different is

ntdll!NtWaitForSingleObject+14  
KERNELBASE!WaitForSingleObjectEx+93  
mfehcinj!Initialize+8566  
mfehcinj!Initialize+87fd  
mfehcinj!Initialize+7f6d  
mfehcinj+1e00  
mvcairo_x64+6037  
mvcairo_x64+5334  
mfehcthe+3975

searching for "mfehcinj" showed this result: #42528

@tiloKo
Copy link
Author

tiloKo commented Dec 17, 2020

so it seems to be caused by McAfee - but why does it only affect go, everything else is working fine...

@mvdan
Copy link
Member

mvdan commented Dec 17, 2020

Antivirus software have a track record of not liking Go programs at all, perhaps because of the runtime and unique compiler. There is not much you can do about it other than report the false positives, because there is nothing wrong with the binaries.

@tiloKo
Copy link
Author

tiloKo commented Dec 17, 2020

I finally could verify it works fine again once the virus scanner got disabled. Now the issue is reported to the vendor and I'm waiting for a new version. Thanks for the support!

@tiloKo tiloKo closed this as completed Dec 17, 2020
@tiloKo
Copy link
Author

tiloKo commented Feb 1, 2021

As per McAfee this issue is realted to usage of WSL/WSL2...
https://kc.mcafee.com/corporate/index?page=content&id=KB91411

@golang golang locked and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants