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: bug in typeCheckBatch.importPackage reported by telemetry #64235

Open
adonovan opened this issue Nov 17, 2023 · 6 comments
Open
Labels
gopls/telemetry-wins 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

@adonovan
Copy link
Member

adonovan commented Nov 17, 2023

This stack 5MRL7A, _ZM1lw was reported by telemetry:

cache.(*typeCheckBatch).importPackage.func1:19 is

			// debugging issue #60904
			if pkg.Name() != item.Name {
				return bug.Errorf("internal error: package name is %q, want %q (id=%q, path=%q) (see issue #60904)",
					pkg.Name(), item.Name, id, item.Path)
			}

gopls/bug
golang.org/x/tools/gopls/internal/bug.report:35
golang.org/x/tools/gopls/internal/bug.Errorf:2
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importPackage.func1:19
golang.org/x/tools/internal/gcimporter.iimportCommon:116
golang.org/x/tools/internal/gcimporter.IImportShallow:3
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importPackage:41
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).getImportPackage:55
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).awaitPredecessors.func1:1
golang.org/x/sync/errgroup.(*Group).Go.func1:3
runtime.goexit:0
golang.org/x/tools/gopls@v0.14.1 go1.21.3 linux/amd64 (2)
golang.org/x/tools/gopls@v0.14.1 go1.19.1 darwin/amd64 (1)

Reported using golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

This stack aiQRfw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:35
golang.org/x/tools/gopls/internal/util/bug.Errorf:2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:14
golang.org/x/tools/internal/gcimporter.iimportCommon:123
golang.org/x/tools/internal/gcimporter.IImportShallow:3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:55
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func1:1
golang.org/x/sync/errgroup.(*Group).Go.func1:3
runtime.goexit:0
golang.org/x/tools/gopls@v0.15.0-pre.2 go1.22rc2 linux/amd64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

Dups: ebxaEQ 2vh0nQ

This stack KVl6Kg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.15.0 go1.22.0 darwin/arm64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

Dups: Ar_rPw

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 17, 2023
@gopherbot gopherbot added this to the Unreleased milestone Nov 17, 2023
@adonovan adonovan changed the title x/tools/gopls: bug reported by telemetry [5MRL7A] x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry [5MRL7A] Nov 17, 2023
@adonovan adonovan changed the title x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry [5MRL7A] x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry Nov 17, 2023
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.15.0 Nov 17, 2023
@findleyr
Copy link
Contributor

Would love to see the error message for this one.

@findleyr
Copy link
Contributor

Since we added this bug report specifically because we couldn't figure it out, I don't think we're going to make easy progress without the content.

I'm not sure what to do about this, but it's not going to get resolved for v0.15.0.

@findleyr findleyr modified the milestones: gopls/v0.15.0, gopls/v0.16.0 Dec 15, 2023
@adonovan
Copy link
Member Author

The 15.0-pre2 stack I just appended to the original node implicates this statement:

				// debugging issues #60904, #64235
				if pkg.Name() != item.Name {
					// This would mean that mp.Name != item.Name, so the
					// manifest in the export data of mp.PkgPath is
					// inconsistent with mp.Name. Or perhaps there
					// are duplicate PkgPath items in the manifest?
					return bug.Errorf("internal error: package name is %q, want %q (id=%q, path=%q) (see issue #60904)",
						pkg.Name(), item.Name, id, item.Path)
				}

@adonovan
Copy link
Member Author

This stack 2vh0nQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=399
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+29
go/types.(*Checker).Files:=372
golang.org/x/tools/gopls@v0.15.0-pre.3 go1.22.0 darwin/arm64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

@adonovan
Copy link
Member Author

This stack ebxaEQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func1:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.15.0-pre.3 go1.22.0 darwin/arm64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

@adonovan
Copy link
Member Author

This stack Ar_rPw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=391
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+32
go/types.(*Checker).Files:=341
golang.org/x/tools/gopls@v0.15.1 go1.21.0 windows/amd64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/telemetry-wins 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