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: sigpanic in persistent.(*mapNode).forEach #71115

Open
adonovan opened this issue Jan 3, 2025 · 3 comments
Open

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

adonovan opened this issue Jan 3, 2025 · 3 comments
Labels
Bug Issues describing a 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 Jan 3, 2025

#!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/[email protected] go1.23.2 linux/amd64 vscode (1)
@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 labels Jan 3, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 3, 2025
@adonovan
Copy link
Member Author

adonovan commented Jan 3, 2025

cc @prattmic

@prattmic
Copy link
Member

prattmic commented Jan 6, 2025

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.

I would expect to see morestack as well, though I need to double check to be certain. But besides that, the stack check should be at line +0, not +1. i.e., we report the call to morestack as the same line number as the func keyword.

@gabyhelp gabyhelp added the Bug Issues describing a bug in the Go implementation. label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues describing a 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

4 participants