Skip to content

cmd/link: panic: index out of range [23] with length 0 #49619

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel go1.18-6c36c332fe Tue Nov 16 18:36:59 2021 +0000 linux/amd64
package main

func f() any {
	var a []any
	return a[0]
}

func main() {
	f()
}
$ gotip build crash.go 

# command-line-arguments
panic: runtime error: index out of range [23] with length 0

goroutine 1 [running]:
cmd/link/internal/ld.decodetypeKind(...)
	/home/alberto/gotip/src/cmd/link/internal/ld/decodesym.go:53
cmd/link/internal/ld.(*dwctxt).newtype(0xc000110af0, 0x87df)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:537 +0x23e7
cmd/link/internal/ld.(*dwctxt).defgotype(0xc000110af0, 0x87df)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:528 +0x125
cmd/link/internal/ld.(*dwctxt).newtype(0xc000110af0, 0x37b7)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:659 +0xb29
cmd/link/internal/ld.(*dwctxt).defgotype(0xc000110af0, 0x37b7)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:528 +0x125
cmd/link/internal/ld.(*dwctxt).importInfoSymbol(0xc000110af0, 0x0?)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:1134 +0x33c
cmd/link/internal/ld.(*dwctxt).dwarfVisitFunction(0xc000110af0, 0x4?, 0xc0000a20d0)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:1717 +0x425
cmd/link/internal/ld.dwarfGenerateDebugInfo(0xc00004e000)
	/home/alberto/gotip/src/cmd/link/internal/ld/dwarf.go:1876 +0x1528
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0x0, 0x0}, {0x67cbc1, ...}, ...})
	/home/alberto/gotip/src/cmd/link/internal/ld/main.go:273 +0xe73
main.main()
	/home/alberto/gotip/src/cmd/link/main.go:69 +0xfe5

cc @randall77 @cherrymui

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions