Skip to content

cmd/compile: internal compiler error: panic: exported package symbol type:... was not preassigned an index #82054

Closed

Description

@johejo

Go version

go version go1.28-devel_b756cce092 Tue Oct 6 19:26:13 2026 -0700 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/mitsuoheijo/go/bin'
GOCACHE='/home/mitsuoheijo/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/mitsuoheijo/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1772748711=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/mitsuoheijo/repos/github.com/golang/go/tmp/go.mod'
GOMODCACHE='/home/mitsuoheijo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPACKAGESDRIVER=''
GOPATH='/home/mitsuoheijo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/mitsuoheijo/repos/github.com/golang/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/mitsuoheijo/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/mitsuoheijo/repos/github.com/golang/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.28-devel_b756cce092 Tue Oct 6 19:26:13 2026 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

https://go.dev/play/p/0VnatU_BM8-?v=gotip

package main

func main() {}

func F() func() {
	type T struct{ x int }
	t := &T{}
	return func() {
		go func() { t.x = 1 }()
	}
}

What did you see happen?

./main.go:9:19: internal compiler error: panic: exported package symbol type:*main.T·1 was not preassigned an index

goroutine 1 [running]:
runtime/debug.Stack()
	../src/runtime/debug/stack.go:26 +0x5e
cmd/compile/internal/base.FatalfAt({0x822873f8?, 0x3ee7?}, {0x102380e, 0x9}, {0x3ee782287428, 0x1, 0x1})
	../src/cmd/compile/internal/base/print.go:232 +0x18b
cmd/compile/internal/base.Fatalf(...)
	../src/cmd/compile/internal/base/print.go:197
cmd/compile/internal/gc.handlePanic()
	../src/cmd/compile/internal/gc/main.go:60 +0x95
panic({0x19cf3c8?, 0x3ee7822a0ea0?})
	../src/runtime/panic.go:859 +0x11f
cmd/internal/obj.(*Link).NumberSyms.func4(0x3ee7822a4380)
	../src/cmd/internal/obj/sym.go:352 +0x479
cmd/internal/obj.(*Link).traverseSyms(0x3ee781fba588, 0x9, 0x3ee7822878b0)
	../src/cmd/internal/obj/sym.go:478 +0x243
cmd/internal/obj.(*Link).NumberSyms(0x3ee781fba588)
	../src/cmd/internal/obj/sym.go:313 +0x4a5
cmd/compile/internal/gc.Main(0x1a41760)
	../src/cmd/compile/internal/gc/main.go:396 +0x1e3c
main.main()
	../src/cmd/compile/main.go:57 +0x105

bisected bcd5def

What did you expect to see?

Build succeeds.

Activity

  1. self-assigned this
    on Oct 7, 2026
  2. gopherbot commented on Oct 7, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/846265 mentions this issue: cmd/compile: preassign index for closure variable types

  3. added a commit that references this issue on Oct 9, 2026
    1d1187a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions