Skip to content

go/types: stack overflow in Alignof #71143

Open
@adonovan

Description

@adonovan
#!stacks
"crash/crash" &&
 ("go/types.(*Named).resolve:+0" || "go/types.(*Named).Underlying:+0") &&
 "go/types.(*Named).under:+1" && 
 "go/types.(*gcSizes).Alignof:+7" &&
 "go/types.(*gcSizes).Alignof:+29"

Issue created by stacks.

Looks like Alignof was applied to a named struct type (illegally) containing itself as its first field.

This stack gYYnog was reported by telemetry:

golang.org/x/tools/gopls@v0.17.1 go1.23.3 windows/amd64 vscode (1)

Dups: 2Xy8hA

Activity

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
goplsIssues related to the Go language server, gopls.
ToolsThis label describes issues relating to any tools in the x/tools repository.
on Jan 6, 2025
adonovan

adonovan commented on Jan 6, 2025

@adonovan
MemberAuthor

Hmm, the underlying type of the struct literal in type S struct { S } is invalid type, so the real question is how did the self-containing struct type get constructed?

added
BugReportIssues describing a possible bug in the Go implementation.
on Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adonovan@gabyhelp

        Issue actions

          go/types: stack overflow in Alignof · Issue #71143 · golang/go