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: hang in "go get -u" #34524

Closed
KevinGimbel opened this issue Sep 25, 2019 · 4 comments
Closed

cmd/go: hang in "go get -u" #34524

KevinGimbel opened this issue Sep 25, 2019 · 4 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@KevinGimbel
Copy link

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

$ go version
go version go1.13 darwin/amd64

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="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kevingimbel/Library/Caches/go-build"
GOENV="/Users/kevingimbel/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/kevingimbel/Development/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m7/zzw3lkfd03v0zrv0d_yvcrbh0000gn/T/go-build953972402=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Tried to update my local version of github.com/spf13/cobra by running go get -u github.com/spf13/cobra

What did you expect to see?

The code on my machine is updated to the latest version.

What did you see instead?

My computer got slow and felt "loaded", so I looked at the System Monitor and the output of ps, here I saw that the process was still running (approx. 1h after running go get -u).

 ps
  PID TTY           TIME CMD
65283 ttys001    0:00.57 /usr/local/bin/bash -l
45722 ttys002    0:00.05 /Applications/iTerm.app/Contents/MacOS/iTerm2 --server /usr/bin/login -fpl kevingimbel /Applications/iTerm.app/Contents/MacOS/iTerm2
45724 ttys002    0:01.29 -bash
47716 ttys002   99:11.28 go get -u github.com/spf13/cobra
64585 ttys003    0:00.05 /Applications/iTerm.app/Contents/MacOS/iTerm2 --server /usr/bin/login -fpl kevingimbel /Applications/iTerm.app/Contents/MacOS/iTerm2
64587 ttys003    0:00.64 -bash

The go get command did not get stuck and it didn't exit with an error code, it was only when running ps that I noticed it was still running. It was using 99% of my CPU when I noticed something was wrong.

@mvdan
Copy link
Member

mvdan commented Sep 25, 2019

Can you provide more details? For example:

Did you run go get -u directly in your terminal/shell, or was it run indirectly by an IDE or program?

Did the go get -u command succeed or fail, or was it killed before it finished? Or did the entire command hang in your terminal?

Are you able to reproduce this hang? If so, what are the steps?

@bcmills
Copy link
Contributor

bcmills commented Sep 25, 2019

If you experience a hang in the go command, please do two things (in order!):

  1. Run pstree on the PID of the stuck go process and save the output.
  2. Kill the stuck go process with SIGQUIT and save the backtrace that it (hopefully) logs on stderr.

Then, attach both of those to the issue report, enclosed in a <details> tag because they'll probably be enormous.

Otherwise, we have essentially no way to figure out what got stuck or why, and thus no way to investigate further.

@bcmills bcmills changed the title "go get -u" runs infinitely cmd/go: hang in "go get -u" Sep 25, 2019
@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Sep 25, 2019
@bcmills bcmills added this to the Go1.14 milestone Sep 25, 2019
@KevinGimbel
Copy link
Author

@mvdan

Did you run go get -u directly in your terminal/shell, or was it run indirectly by an IDE or program?

I ran the command directly inside my Terminal (iTerm2) using Bash.

$ bash --version
5.0.7(1)-release (x86_64-apple-darwin18.5.0)

Did the go get -u command succeed or fail, or was it killed before it finished? Or did the entire command hang in your terminal?

go get exited without error and looked to be just finished; Then later I saw it was somehow still running in the background (or something like this, I'm not 100% sure about this).


@bcmills I tried recreating the issue but it doesn't happen again. If I encounter it again I'll update this issue.

Other stuff worth noting: Just before the issue happened I upgraded from go 1.12 to the latest release 1.13.. Maybe this has something to do with it? The installation was done with the installer downloaded from https://golang.org/dl/

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@mvdan
Copy link
Member

mvdan commented Jun 15, 2021

Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen.

@mvdan mvdan closed this as completed Jun 15, 2021
@golang golang locked and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants