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/go: go list locks at 100% cpu usage #52536

Closed
andig opened this issue Apr 25, 2022 · 5 comments
Closed

cmd/go: go list locks at 100% cpu usage #52536

andig opened this issue Apr 25, 2022 · 5 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@andig
Copy link
Contributor

andig commented Apr 25, 2022

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

$ go version
go version go1.18.1 darwin/arm64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18.1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.1/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build1945771030=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.18.1 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.18.1
uname -v: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101
ProductName:	macOS
ProductVersion:	12.3
BuildVersion:	21E230
lldb --version: lldb-1316.0.9.41
Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

What did you do?

Develop in VScode

What did you expect to see?

No go processes after closing VScode

What did you see instead?

Lingering go list process at 100% CPU.

Screenshot 2022-04-25 at 09 32 59

While this is not reproducible, it has happened multiple times. My question is what further diagnosis I could do when this happens again. Can I run pprof on the go list instance?

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@andig
Copy link
Contributor Author

andig commented Apr 25, 2022

Imho a hanging go list is a bug. Asking how to contribute to diagnosis does not take that away.

@ianlancetaylor
Copy link
Contributor

Reopening to see if we can find the problem.

A good start is to send the go list process a SIGQUIT. Then attach the stack trace here. If you can't get the stack trace, try attaching to the process using gdb or lldb and getting a backtrace of all threads.

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 26, 2022
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Apr 26, 2022
@0xmohit
Copy link
Contributor

0xmohit commented Apr 26, 2022

I've run into this with vim-go. The following process was stuck

go list -mod=readonly -overlay=/tmp/gopackages-2148913831/overlay.json -e -json -compiled=true -test=true -export=false -deps=true -find=false -- /absolute/path/to/some/go/module

The contents of overlay.json were similar to:

{
  "replace": {
    "/absolute/path/to/some/go/module/foo.go": "/tmp/gopackages-2148913831/150853033-absolutepathtosomegomodulefoo.go"
  }
}

Interestingly, the contents of /tmp/gopackages-2148913831/150853033-absolutepathtosomegomodulefoo.go weren't Go code but was identical to another file in the repo.

@andig
Copy link
Contributor Author

andig commented Jul 22, 2023

Haven't seen this issue in a long time- closing.

@andig andig closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants