Skip to content

x/tools/gopls: sigpanic in persistent.(*mapNode).forEach (bad SP) #71115

Description

@adonovan
#!stacks
"runtime.sigpanic" && "persistent.(*mapNode).forEach:+1"

Issue created by stacks.

This stack looks wrong, perhaps another example of the off-by-one problems in the traceback?
(Is it possible that somehow the tree has become a cyclic graph and what we are seeing is a stack overflow? The line number supports that, but I would expect the failure in that case to occur in runtime.morestack_noctxt.)

func (node *mapNode) forEach(f func(key, value any)) {
	if node == nil {   // <--- sigpanic
		return
	}
	node.left.forEach(f)
	f(node.key, node.value.value)
	node.right.forEach(f)
}

This stack dVh6PA was reported by telemetry:

golang.org/x/tools/gopls@v0.17.0 go1.23.2 linux/amd64 vscode (1)

Activity

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/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions