Skip to content

x/tools/gopls: Package.Path called on nil Package in AddTestForFunc #73687

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

Open
adonovan opened this issue May 13, 2025 · 1 comment
Open

x/tools/gopls: Package.Path called on nil Package in AddTestForFunc #73687

adonovan opened this issue May 13, 2025 · 1 comment
Assignees
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented May 13, 2025

#!stacks
"sigpanic" && "types.(*Package).Path" && "AddTestForFunc.func4"

Issue created by stacks.

Another case of calling Obj().Pkg().Path() without checking for nil (unsafe.Pointer or builtin-in error):

	var isContextType = func(t types.Type) bool {
		named, ok := t.(*types.Named)
		if !ok {
			return false
		}
		return named.Obj().Pkg().Path() == "context" && named.Obj().Name() == "Context" <--- SEGV here
	}

This stack 651rTQ was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.6 darwin/arm64 other (1)
@adonovan adonovan added this to the gopls/v0.19.0 milestone May 13, 2025
@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. gopls/telemetry-wins BugReport Issues describing a possible bug in the Go implementation. labels May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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