Skip to content

cmd/compile: internal compiler error: assertion failed in convertUsingDictionary #48598

@ghost

Description

What version of Go are you using (go version)?

$ go version
go version devel go1.18-d413908320 Fri Sep 24 07:22:13 2021 +0000 windows/amd64

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

  • windows/amd64
  • linux/amd64 (godbolt)

What did you do?

https://play.golang.org/p/rYeZ3-VjX6H

https://go.godbolt.org/z/35ssY4hes

What did you expect to see?

Successful compilation.

What did you see instead?

ICE caused by assertion

// We should have an itab entry in the dictionary. Using this itab
// will be more efficient than converting to an empty interface first
// and then type asserting to dst.
ix := -1
for i, ic := range info.dictInfo.itabConvs {
if ic == in {
ix = info.dictInfo.startItabConv + i
break
}
}
assert(ix >= 0)
rt = getDictionaryEntry(pos, dictParam, ix, info.dictInfo.dictLen)

Stack trace
./example.go:20:2: internal compiler error: assertion failed

goroutine 1 [running]:
runtime/debug.Stack()
	/root/master/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xe1180, 0xc0}, {0xce3fbe, 0x10}, {0x0, 0x0, 0x0})
	/root/master/go/src/cmd/compile/internal/base/print.go:227 +0x154
cmd/compile/internal/base.Fatalf(...)
	/root/master/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/base.Assert(...)
	/root/master/go/src/cmd/compile/internal/base/print.go:239
cmd/compile/internal/noder.assert(...)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:27
cmd/compile/internal/noder.convertUsingDictionary(0xc0000a0ac8, 0xc0000f0a80, {0xffffffff, 0xffffffff}, {0xe4dd90, 0xc0000e4c30}, {0xe4dd90, 0xc0000fc0f0}, 0xc0000e1180)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1388 +0x9da
cmd/compile/internal/noder.(*irgen).dictPass.func1({0xe4dd90, 0xc0000fc0f0})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1237 +0x345
cmd/compile/internal/ir.editNodes({0xc0000f0a40, 0x2, 0x44fca9}, 0xc0000f0a80)
	/root/master/go/src/cmd/compile/internal/ir/node_gen.go:1521 +0x74
cmd/compile/internal/ir.(*CallExpr).editChildren(0xc0000b8630, 0xc0000f0a80)
	/root/master/go/src/cmd/compile/internal/ir/node_gen.go:276 +0xb4
cmd/compile/internal/ir.EditChildren(...)
	/root/master/go/src/cmd/compile/internal/ir/visit.go:185
cmd/compile/internal/noder.(*irgen).dictPass.func1({0xe4d818, 0xc0000b8630})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1177 +0x74
cmd/compile/internal/ir.editNodes({0xc00009c6d0, 0x1, 0xc00009c920}, 0xc0000f0a80)
	/root/master/go/src/cmd/compile/internal/ir/node_gen.go:1521 +0x74
cmd/compile/internal/ir.(*Func).editChildren(0x40aaa7, 0x10)
	/root/master/go/src/cmd/compile/internal/ir/func.go:153 +0x2e
cmd/compile/internal/ir.EditChildren(...)
	/root/master/go/src/cmd/compile/internal/ir/visit.go:185
cmd/compile/internal/noder.(*irgen).dictPass.func1({0xe4e178, 0xc00009e840})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1177 +0x74
cmd/compile/internal/noder.(*irgen).dictPass(0xc0000d2000, 0xc0000a0ac8)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1305 +0x126
cmd/compile/internal/noder.(*irgen).stencil(0xc0000d2000)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:240 +0x51b
cmd/compile/internal/noder.(*irgen).generate(0xc0000d2000, {0xc00002ebb0, 0x2, 0xb})
	/root/master/go/src/cmd/compile/internal/noder/irgen.go:301 +0x359
cmd/compile/internal/noder.check2({0xc00002ebb0, 0x2, 0x2})
	/root/master/go/src/cmd/compile/internal/noder/irgen.go:93 +0x175
cmd/compile/internal/noder.LoadPackage({0xc00001e250, 0x2, 0x0})
	/root/master/go/src/cmd/compile/internal/noder/noder.go:90 +0x335
cmd/compile/internal/gc.Main(0xd0ba30)
	/root/master/go/src/cmd/compile/internal/gc/main.go:190 +0xaf3
main.main()
	/root/master/go/src/cmd/compile/main.go:55 +0xdd

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions