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: automated issue report (crash) #47472

Closed
josharian opened this issue Jul 29, 2021 · 3 comments
Closed

x/tools/gopls: automated issue report (crash) #47472

josharian opened this issue Jul 29, 2021 · 3 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

@josharian
Copy link
Contributor

gopls version: v0.7.0
gopls flags: -rpc.trace serve --debug=localhost:6066
update flags: proxy
extension version: 0.26.0
go version: 1.16.6
environment: Visual Studio Code darwin
initialization error: undefined
manual restart count: 0
total start count: 1

Describe what you observed.

Opened runtime/malloc.go, which contained merge conflict markers. The relevant bit of code:

	// logHeapArenaBytes is log_2 of heapArenaBytes. For clarity,
	// prefer using heapArenaBytes where possible (we need the
	// constant to compute some other constants).
<<<<<<< HEAD
	logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoarchWasm)*(1-sys.GoosIos*sys.GoarchArm64)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm + (2+20)*sys.GoosIos*sys.GoarchArm64
||||||| parent of fad3ef219d ([tailscale1.16] runtime: add "runtime_small_arena" build tag to force 4MB heap arenas)
	logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoarchWasm)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm
=======
	logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoarchWasm)*(1-want4MB)) + (2+20)*(_64bit*sys.GoosWindows*(1-want4MB)) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm*(1-want4MB) + (2+20)*want4MB
>>>>>>> fad3ef219d ([tailscale1.16] runtime: add "runtime_small_arena" build tag to force 4MB heap arenas)
panic: assertion failed

goroutine 231 [running]:
go/types.(*Checker).handleBailout(0x14000017200, 0x14001f0f648)
	  check.go:245  0xa8
panic(0x100e4d1e0, 0x100f8f238)
	  panic.go:965  0x14c
go/types.assert(...)
	  errors.go:20
go/types.(*Checker).shift(0x14000017200, 0x1400226c500, 0x1400226c580, 0x14000c259b0, 0x14)
	  expr.go:709  0x99c
go/types.(*Checker).binary(0x14000017200, 0x1400226c500, 0x14000c259b0, 0x100fb2420, 0x14000648260, 0x100fb27e0, 0x14000648280, 0x14, 0x45a6d)
	  expr.go:821  0x108
go/types.(*Checker).exprInternal(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c259b0, 0x0, 0x0, 0x0)
	  expr.go:1553  0x178c
go/types.(*Checker).rawExpr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c259b0, 0x0, 0x0, 0x40)
	  expr.go:1029  0x50
go/types.(*Checker).multiExpr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c259b0)
	  expr.go:1652  0x44
go/types.(*Checker).expr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c259b0)
	  expr.go:1646  0x40
go/types.(*Checker).binary(0x14000017200, 0x1400226c500, 0x14000c25a10, 0x100fb2450, 0x14000c259b0, 0x100fb27e0, 0x140006482a0, 0x2c, 0x45a81)
	  expr.go:808  0x60
go/types.(*Checker).exprInternal(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c25a10, 0x0, 0x0, 0x100e9cdc0)
	  expr.go:1553  0x178c
go/types.(*Checker).rawExpr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c25a10, 0x0, 0x0, 0x40)
	  expr.go:1029  0x50
go/types.(*Checker).multiExpr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c25a10)
	  expr.go:1652  0x44
go/types.(*Checker).expr(0x14000017200, 0x1400226c500, 0x100fb2450, 0x14000c25a10)
	  expr.go:1646  0x40
go/types.(*Checker).stmt(0x14000017200, 0x0, 0x100fb26c0, 0x14000628280)
	  stmt.go:735  0x191c
go/types.(*Checker).stmtList(0x14000017200, 0x0, 0x14000a74690, 0x1, 0x1)
	  stmt.go:120  0xc4
go/types.(*Checker).stmt(0x14000017200, 0x0, 0x100fb2480, 0x14000c25bc0)
	  stmt.go:495  0x3a9c
go/types.(*Checker).stmt(0x14000017200, 0x0, 0x100fb2810, 0x140006282c0)
	  stmt.go:507  0x3d34
go/types.(*Checker).stmtList(0x14000017200, 0x0, 0x14000a29000, 0x13, 0x20)
	  stmt.go:120  0xc4
go/types.(*Checker).funcBody(0x14000017200, 0x14000fd4d80, 0x140006071d0, 0xa, 0x14001090690, 0x14000c5a030, 0x0, 0x0)
	  stmt.go:42  0x168
go/types.(*Checker).funcDecl.func1()
	  decl.go:749  0x5c
go/types.(*Checker).processDelayed(0x14000017200, 0x0)
	  check.go:291  0x3c
go/types.(*Checker).checkFiles(0x14000017200, 0x14001619c00, 0x77, 0x80, 0x0, 0x0)
	  check.go:267  0xb4
go/types.(*Checker).Files(...)
	  check.go:250
golang.org/x/tools/internal/lsp/cache.doTypeCheck(0x100fb43f8, 0x140003e8a80, 0x140001c07e0, 0x140003dc0e0, 0x2, 0x14000476e70, 0x0, 0x0, 0x0, 0x0)
	  check.go:531  0xa30
golang.org/x/tools/internal/lsp/cache.typeCheck(0x100fb43f8, 0x140003e8a80, 0x140001c07e0, 0x140003dc0e0, 0x2, 0x14000476e70, 0x140007ca600, 0x0, 0x0)
	  check.go:309  0x6c
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildPackageHandle.func1(0x100fb43f8, 0x140003e8a80, 0x100fa1998, 0x140001c07e0, 0x140001703c0, 0x100fb4a88)
	  check.go:120  0x158
golang.org/x/tools/internal/memoize.(*Handle).run.func1(0x14000390320, 0x100fb43f8, 0x140003e8a80, 0x14000279340, 0x100fa1998, 0x140001c07e0, 0x140007cb320)
	  memoize.go:322  0x84
created by golang.org/x/tools/internal/memoize.(*Handle).run
	  memoize.go:315  0x138
[Error - 2:16:13 PM] 
@hyangah hyangah transferred this issue from golang/vscode-go Jul 30, 2021
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 30, 2021
@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: automated issue report (crash) Jul 30, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jul 30, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jul 30, 2021
@hyangah
Copy link
Contributor

hyangah commented Jul 30, 2021

The assertion location is here

assert(yval.Kind() == constant.Int)

It can be reproduced with gopls built with go1.16,
not with gopls built with go1.17 rc1 or tip.

@hyangah hyangah added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 30, 2021
@findleyr
Copy link
Contributor

Thanks for the report. This looks like a dupe of #43765. Nice to have a repro.

This code has changed significantly in go/types in 1.17. In particular, we're more careful about not relying on the relationship between constant kinds and types. CC @griesemer

I don't think there's anything we can do here, since this will be fixed in go/types for 1.17.

@hyangah hyangah removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 30, 2021
@hyangah
Copy link
Contributor

hyangah commented Jul 30, 2021

Will be addressed with 1.17. Closing.

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

4 participants