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/gopls: fatal error: concurrent map iteration and map write on initialization #37798

Closed
tonyghita opened this issue Mar 11, 2020 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@tonyghita
Copy link

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

$ go version
go version go1.14 darwin/amd64

Does this issue reproduce with the latest release?

Yes, gopls/v0.3.3.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tonyghita/Library/Caches/go-build"
GOENV="/Users/tonyghita/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY="*"
GONOSUMDB="*"
GOOS="darwin"
GOPATH="/Users/tonyghita/go"
GOPRIVATE="*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/tonyghita/go/src/my.corp.com/org/project/go.mod"
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/gv/vdmq3_l541b_0lq_ds37xslnzgdpkw/T/go-build637446033=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Start VSCode with gopls enabled in my fairly large internal project.

What did you expect to see?

I expected gopls to initialize without crashing.

What did you see instead?

gopls gets stuck in a crash loop, until it stops trying to start.

[Info  - 9:34:16 AM] 2020/03/11 09:34:16 go/packages.Load
	snapshot = 0
	query = [./... builtin]
	packages = 103
fatal error: concurrent map iteration and map write
fatal error: concurrent map iteration and map write

I've attached the crash logs.

@gopherbot gopherbot added this to the Unreleased milestone Mar 11, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Mar 11, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Mar 11, 2020
@tonyghita tonyghita changed the title x/tools/gopls: <fill this in> x/tools/gopls: fatal error: concurrent map iteration and map write on initialization Mar 11, 2020
@stamblerre
Copy link
Contributor

Thanks for reporting! I think this bug was fixed by https://go-review.googlesource.com/c/tools/+/221897, which hasn't yet been released. You can confirm if the problem was fixed by getting gopls at master: GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master. We'll try to release gopls/v0.3.4 soon to get this fix out.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Mar 11, 2020
@tonyghita
Copy link
Author

tonyghita commented Mar 11, 2020

Thanks @stamblerre! I verified that this issue is fixed in the following revisions

GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master
go: downloading golang.org/x/tools v0.0.0-20200311090712-aafaee8bce8c
go: downloading golang.org/x/tools/gopls v0.1.8-0.20200311090712-aafaee8bce8c
go: golang.org/x/tools/gopls master => v0.1.8-0.20200311090712-aafaee8bce8c
go: golang.org/x/tools master => v0.0.0-20200311090712-aafaee8bce8c

@stamblerre
Copy link
Contributor

Thanks for following up! Closing this issue, as I've cherry-picked the fix onto gopls-release-branch.0.3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants