Go version
go version go1.24.4 darwin/arm64
Output of go env
in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='//Users/nikolaydubina/go/bin'
GOCACHE='/Users/nikolaydubina/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/nikolaydubina/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/dt/1y99_j6s0yj7y151_dr026gh0000gn/T/go-build3775709135=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/nikolaydubina/Workspace/ndx/mm-go/go.mod'
GOMODCACHE='/Users/nikolaydubina/go/pkg/mod'
GONOPROXY='github.com/ndx-technologies'
GONOSUMDB='github.com/ndx-technologies'
GOOS='darwin'
GOPATH='/Users/nikolaydubina/go'
GOPRIVATE='github.com/ndx-technologies'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/nikolaydubina/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.4'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
coding in VSCode
What did you see happen?
go pls keeps crashing every 2 min. need restart VSCode.
panic and very long stack trace
What did you expect to see?
no crash
Crash report URL generated by VSCode gopls is too long to fit into browser. so here is PDF of that URL. from which I can see some panics happening
Comment From: nikolaydubina
https://github.com/golang/vscode-go/issues/3786
Comment From: gabyhelp
Related Issues
- x/tools/gopls: gopls crash with vscode-go in remote development #39789 (closed)
- x/tools/gopls: panic and crash in golang.org/x/telemetry/internal/counter #64577 (closed)
- x/tools/gopls: begins to fail after some use #32545 (closed)
- x/tools/gopls: macOS kernel panic after heavy file IO #73139 (closed)
- x/tools/gopls: panic in analysis #60551 (closed)
- x/tools/gopls: panic: getSnapshot called after shutdown #52543 (closed)
- x/tools/gopls: Crash with "concurrent map read and map write" #37914 (closed)
- x/tools/gopls: crash importing test variant of tools file #66109 (closed)
- x/tools/gopls: vscode take minutes to load packages before completion becomes available #69743 (closed)
- x/tools/gopls: fatal error: concurrent map iteration and map write on initialization #37798 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: nikolaydubina
~ok, issue seem to be mitigated after upgrading golang.org/x/tools v0.33.0
to golang.org/x/tools v0.34.0
in my go.mod~
~but how come go.mod in some project affects how Go VSCode + gopls itself works?~
~is this fallout from mixing tools version management vs definition of code itself? (e.g. controversial long threads about go tools in HN?)~
btw, automatic go.mod dependency upgrades also stopped worked couple months ago. now I am using go get -u ./...
instead, since VSCode "upgrade dependencies" does not work. not sure if related...
UPD: crash still happening
Comment From: nikolaydubina
disabling new cache mechanism in https://github.com/golang/tools/releases/tag/gopls%2Fv0.19.0 seem to help
Comment From: findleyr
CC @adonovan @pjweinb we should patch a fix.
Comment From: adonovan
Please try installing the 19.1 prerelease and let us know if it solves this problem:
$ go install golang.org/x/tools/gopls@v0.19.1-pre.1
Comment From: nikolaydubina
no crash for me happens with golang.org/x/tools/gopls@v0.19.1-pre.1