-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues 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.Someone 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.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins
Milestone
Description
#!stacks
"sigpanic" && "maps.(*Map).Used"
Issue created by stacks.
The crash indicates that the types.Scope's elems map is nonzero but an invalid pointer, since the load instruction is dominated by a nil check:
TEXT runtime.mapaccess1_faststr(SB) internal/runtime/maps/runtime_faststr_swiss.go
...
runtime_faststr_swiss.go:110 0x40f920 4885db TESTQ BX, BX m == nil?
runtime_faststr_swiss.go:110 0x40f923 0f84ef000000 JE 0x40fa18
map.go:394 0x40f929 48833b00 CMPQ 0(BX), $0x0 load m.used, SEGV
runtime_faststr_swiss.go:110 0x40f92d 0f84e5000000 JE 0x40fa18
More memory corruption. Perhaps the types.Scope's elems field has been clobbered.
This stack aoCxtQ was reported by telemetry:
crash/crashruntime.throw:+9,+0x47runtime.sigpanic:+33,+0x26binternal/runtime/maps.(*Map).Used:=394,+0x29runtime.mapaccess1_faststr:+7,+0x20go/types.(*Scope).Lookup:+1,+0x34go/types.(*environment).lookupScope:+2,+0x51go/types.(*environment).lookup:=111,+0xb3go/types.(*Checker).selector:+14,+0x8ego/types.(*Checker).typInternal:+43,+0x2e4go/types.(*Checker).definedType:+1,+0x2ego/types.(*Checker).varType:+1,+0x24go/types.(*Checker).varDecl:+5,+0x84go/types.(*Checker).declStmt.func1:+56,+0xac8go/types.(*Checker).walkDecl:+27,+0x3ddgo/types.(*Checker).declStmt:+3,+0x3bgo/types.(*Checker).stmt:+23,+0x5a4go/types.(*Checker).stmtList:+9,+0x84go/types.(*Checker).funcBody:+24,+0x310
golang.org/x/tools/[email protected] 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/[email protected] && find $HOME/go/bin -type f)
To disassemble: go tool objdump exe | less
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues 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.Someone 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.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins