Skip to content

x/tools/gopls: impossible SEGV in DecodeRune #76252

@adonovan

Description

@adonovan
#!stacks
"sigpanic" && "utf8.DecodeRune:+5"

Issue created by stacks.

Blatant memory corruption:

func DecodeRune(p []byte) (r rune, size int) {
	n := len(p)
	if n < 1 {
		return RuneError, 0
	}
	p0 := p[0] // <--- SEGV

I wonder whether there is any point to creating new issues for cases like this that are clearly just symptoms of the same problem peppering the entire code base at random like a cloud of gunshot. Weirdly though, we got two reports of near-identical crashes within the same 24 hour period, just as we did with #76254.

This stack z3MN_w was reported by telemetry:

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

Dups: 5l7xNA

Metadata

Metadata

Assignees

No one assigned

    Labels

    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