Skip to content

x/tools/gopls: SEGV reading through bad *types.Func pointer returned by Scope.Lookup #77174

Description

@adonovan
#!stacks
"sigpanic" && "types.(*Func).Pkg:+0,+0x0" && "pushDecl"

Issue created by stacks.

More memory corruption.

This stack 1K4m2A was reported by telemetry:

golang.org/x/tools/gopls@v0.21.0 go1.25.2 linux/amd64 gopls.client=other,vscode (1)

Use this command to reproduce the executable:
(HOME=$(mktemp -d); GOOS=linux GOARCH=amd64 GOTOOLCHAIN=go1.25.2 go install golang.org/x/tools/gopls@v0.21.0 && find $HOME/go/bin -type f)
To disassemble: go tool objdump exe | less

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/telemetry-wins

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions