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: improve instrumentation for corrupt export data during import #63822

Open
findleyr opened this issue Oct 30, 2023 · 13 comments
Open
Assignees
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

@findleyr
Copy link
Contributor

findleyr commented Oct 30, 2023

Telemetry data at https://storage.googleapis.com/prod-telemetry-merged/2023-10-28.json clearly demonstrates a package that cannot be imported: there are in fact two bug reports, one each in type checking (#64235) and analysis (#64236).

Clearly some invariant is being violated. We should use the reportf callback passed into the importer to get a more accurate stack, as otherwise this is unlikely to be actionable (we can't see the error message in telemetry, which we probably didn't consider when adding this instrumentation).

Putting this in the v0.14.2 milestone as it would be nice to get to the bottom of this error. I'll push down the instrumentation.

CC @adonovan

Dups: BQtcLQ m5UK3A W_lHAg du4kbA PDrh5Q jZbDKQ 4elxTA JhOH0g oat8ig wr44gQ 6j0bvA 9wAdDQ 6LjVfg A3ISjw nJQxXw

@findleyr findleyr added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Oct 30, 2023
@findleyr findleyr added this to the gopls/v0.14.2 milestone Oct 30, 2023
@findleyr findleyr changed the title x/tools/gopls: corrupt export data during import x/tools/gopls: improve instrumentation for corrupt export data during import Oct 30, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.2, gopls/v0.15.0 Nov 14, 2023
@adonovan adonovan self-assigned this Feb 2, 2024
@gopherbot
Copy link

Change https://go.dev/cl/560795 mentions this issue: gopls/internal/cache: add assertions for export data inconsistency

@findleyr findleyr modified the milestones: gopls/v0.15.0, gopls/v0.16.0 Feb 3, 2024
gopherbot pushed a commit to golang/tools that referenced this issue Feb 3, 2024
This change pushes the assertions more deeply into the type
checking logic so that we might have a chance of understanding
the recurring inconsistency problems reported by telemetry.

Updates golang/go#63822

Change-Id: I1371f7aa7104df0c55e055a11e9e6bb15219d79a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/560795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
@adonovan
Copy link
Member

adonovan commented Mar 4, 2024

The "inconsistent view of dependencies" assertion was hit:

This stack BQtcLQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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
golang.org/x/tools/gopls@v0.15.1 go1.21.4 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member

adonovan commented Mar 5, 2024

This stack m5UK3A was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.21.4 darwin/arm64 neovim,vscode (2)

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

@adonovan
Copy link
Member

adonovan commented Mar 9, 2024

This stack W_lHAg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.1 go1.22.0 darwin/arm64 other,vscode (4)

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

@adonovan
Copy link
Member

adonovan commented Mar 9, 2024

This stack du4kbA was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.1 go1.22.0 darwin/arm64 other,vscode (1)

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

@adonovan
Copy link
Member

adonovan commented Mar 9, 2024

This stack PDrh5Q was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.1 go1.22.0 darwin/arm64 other,vscode (1)

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

@adonovan
Copy link
Member

This stack jZbDKQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.1 go1.22.0 darwin/arm64 other,vscode (4)

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

This stack 4elxTA was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.1 go1.22.0 linux/amd64 other (2)

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

This stack JhOH0g was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.2 go1.22.0 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member

This stack oat8ig was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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
golang.org/x/tools/gopls@v0.15.2 go1.22.0 darwin/amd64 vscode (1)

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

@adonovan
Copy link
Member

This stack wr44gQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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
golang.org/x/tools/gopls@v0.15.2 go1.22.0 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member

adonovan commented Apr 4, 2024

This stack 6j0bvA was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.2 go1.22.0 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member

adonovan commented Apr 4, 2024

This stack 9wAdDQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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
golang.org/x/tools/gopls@v0.15.2 go1.22.1 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member

This stack 6LjVfg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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
golang.org/x/tools/gopls@v0.15.2 go1.22.1 linux/amd64 vscode (1)

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

This stack A3ISjw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+11
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.2 go1.22.0 darwin/arm64 vscode (4)

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

@adonovan
Copy link
Member

This stack nJQxXw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap.func1:+6
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importMap:+18
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+4
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.2 go1.22.0 darwin/arm64 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