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

x/tools/cmd/goimports: hangs in uninterruptible sleep #19225

tcoffee-google opened this issue Feb 21, 2017 · 7 comments

x/tools/cmd/goimports: hangs in uninterruptible sleep #19225

tcoffee-google opened this issue Feb 21, 2017 · 7 comments


Copy link

@tcoffee-google tcoffee-google commented Feb 21, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7.3 linux/amd64

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

GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build134362667=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run goimports -w myfile.go.

What did you expect to see?

Program termination.

What did you see instead?

The goimports process goes into uninterruptible sleep, blocking on disk I/O (status 'D') for at least 20 minutes, and hence cannot be killed without rebooting.

Copy link

@kevinburke kevinburke commented Feb 21, 2017

tcoffee-google, is there anything special or interesting about myfile.go?

Copy link

@bradfitz bradfitz commented Feb 21, 2017

Are you using one of Google's internal FUSE filesystems? If so I'd mail the Google internal mailing lists for tips.

@gopherbot gopherbot added this to the Unreleased milestone Mar 21, 2017
Copy link

@aeneasr aeneasr commented Oct 9, 2018

I have the same issue on Windows, it's a larger project. Command goimports $(go list -f {{.Dir}} ./... | grep -v vendor) outputs files but is incredibly slow - probably 1-2 seconds per file? Running with flags -d or -w nothing happens and goimport just hangs. I'm not sure if it's just very slow to process everything or if it really hangs. This took at most 2 seconds some time back.

I recently did go get -u and used your (@bradfitz ) version before that but I'm experiencing the same issue when downgrading. I recently upgraded to Go 1.11.1

Also, goimports runs with almost zero resources used (CPU, Disk, Memory):


Any ideas?

Copy link

@aeneasr aeneasr commented Oct 9, 2018

After a reboot the issue persists. What's interesting though is that gofmt works perfectly, so I doubt that this is an OS issue.

Copy link

@gopherbot gopherbot commented Nov 1, 2018

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Nov 1, 2018
Copy link

@arnavsharma93 arnavsharma93 commented Dec 30, 2018

I'm facing this too. goimports used to be much faster. Now, it hangs my editor for a second or two. Any idea how to fix it?

Copy link

@bradfitz bradfitz commented Jan 2, 2019

@arnavsharma93, this is a closed bug and we don't track closed bugs. If you want to open a new bug, please include a lot more info. Piling on this overloaded bug just gets distracting.

@golang golang locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.