Skip to content

go/types, x/tools/gopls: crash when editing gioui.org/app/os_x11.go #59944

Closed
@kortschak

Description

@kortschak

gopls version

2563079

go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/user/bin"
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/user/pkg/mod"
GONOPROXY="git.sr.ht"
GONOSUMDB="git.sr.ht"
GOOS="linux"
GOPATH="/home/user"
GOPRIVATE="git.sr.ht"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/user/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/user/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/user/src/gioui.org/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3558781779=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. Open gioui.org/app/os_x11.go at 59695984e53cff7ed440b054318dbd421285421e in Sublime Text.
  2. Wait
  3. Crash

What did you expect to see?

No crash.

What did you see instead?

:: <-  gopls window/logMessage: {'message': '2023/05/03 19:58:23 go/packages.Load #1: updating metadata for 209 packages\n', 'type': 3}
:: <-  gopls $/progress: {'value': {'message': 'Finished loading packages.', 'kind': 'end'}, 'token': '1223999446160520122'}
:: <-- gopls client/registerCapability(3): {'registrations': [{'id': 'workspace/didChangeConfiguration', 'method': 'workspace/didChangeConfiguration'}]}
:: >>> gopls 3: None
:: <-  gopls textDocument/publishDiagnostics: {'diagnostics': [], 'uri': 'file:///.../src/gioui.org/app/os_x11.go'}
:: <-  gopls textDocument/publishDiagnostics: {'diagnostics': [{'codeDescription': {'href': 'https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod'}, 'message': 'caps.MinExtent undefined (type vk._Ctype_struct_VkSurfaceCapabilitiesKHR has no field or method MinExtent)', 'severity': 1, 'code': 'MissingFieldOrMethod', 'range': {'end': {'line': 177, 'character': 33}, 'start': {'line': 177, 'character': 24}}, 'source': 'compiler'}, {'codeDescription': {'href': 'https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod'}, 'message': 'caps.MaxExtent undefined (type vk._Ctype_struct_VkSurfaceCapabilitiesKHR has no field or method MaxExtent)', 'severity': 1, 'code': 'MissingFieldOrMethod', 'range': {'end': {'line': 177, 'character': 51}, 'start': {'line': 177, 'character': 42}}, 'source': 'compiler'}], 'uri': 'file:///.../src/gioui.org/app/vulkan.go'}
gopls: panic: couldn't find method func (*gioui.org/shader/piet._Ctype_struct_backdrop_descriptor_set_layout).Binding0() *gioui.org/cpu._Ctype_struct_buffer_descriptor on type gioui.org/shader/piet._Ctype_struct_backdrop_descriptor_set_layout
gopls: 
gopls: goroutine 3355 [running]:
gopls: golang.org/x/tools/go/types/objectpath.(*Encoder).concreteMethod(0xc0046a9b70?, 0xc004f59980)
gopls: 	.../src/golang.org/x/tools/go/types/objectpath/objectpath.go:421 +0x2fb
gopls: golang.org/x/tools/go/types/objectpath.(*Encoder).For(0xc003be5be8?, {0x116dd38, 0xc004f59980})
gopls: 	.../src/golang.org/x/tools/go/types/objectpath/objectpath.go:244 +0x2e5
gopls: golang.org/x/tools/go/types/objectpath.For(...)
gopls: 	.../src/golang.org/x/tools/go/types/objectpath/objectpath.go:120
gopls: golang.org/x/tools/internal/facts.(*Set).Encode(0xc0059ff110)
gopls: 	.../src/golang.org/x/tools/internal/facts/facts.go:260 +0x17f
gopls: golang.org/x/tools/gopls/internal/lsp/cache.(*action).exec(0xc000352fc0)
gopls: 	.../src/golang.org/x/tools/gopls/internal/lsp/cache/analysis.go:1113 +0xcbf
gopls: golang.org/x/tools/gopls/internal/lsp/cache.execActions.func1.1()
gopls: 	.../src/golang.org/x/tools/gopls/internal/lsp/cache/analysis.go:898 +0x3c
gopls: sync.(*Once).doSlow(0xc002658c00?, 0x95e360?)
gopls: 	.../go/src/sync/once.go:74 +0xc2
gopls: sync.(*Once).Do(...)
gopls: 	.../go/src/sync/once.go:65
gopls: golang.org/x/tools/gopls/internal/lsp/cache.execActions.func1()
gopls: 	.../src/golang.org/x/tools/gopls/internal/lsp/cache/analysis.go:896 +0x85
gopls: created by golang.org/x/tools/gopls/internal/lsp/cache.execActions
gopls: 	.../src/golang.org/x/tools/gopls/internal/lsp/cache/analysis.go:894 +0x3c

Editor and settings

Sublime Text.

Logs

Above.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/incremental

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions