Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: internal compiler error: Unexpected function instantiation {funcName} with no body #50485

Closed
csgura opened this issue Jan 7, 2022 · 3 comments
Labels
NeedsInvestigation release-blocker
Milestone

Comments

@csgura
Copy link

@csgura csgura commented Jan 7, 2022

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

$ go version
go version devel go1.18-07525e1 Fri Jan 7 00:15:59 2022 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

The gotip playground

What did you do?

https://gotipplay.golang.org/p/ivSdCU7-MN5

What did you expect to see?

No Error.

What did you see instead?

# goerror
./fp/fp.go:61:20: internal compiler error: Unexpected function instantiation fp.Option[goerror/hlist.Nil,goerror/hlist.Nil,goerror/ord.Option.T,goerror/ord.Option.T,bool].OrElse with no body

goroutine 1 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x13df4a10?, 0x7f0f?}, {0xd3e451, 0x31}, {0xc00052f298, 0x1, 0x1})
	/usr/local/go/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/noder.(*genInst).getInstantiation(0x138ee00, 0xc0003fadd0, {0xc000534658, 0x1, 0xc00052f330?}, 0x7c?)
	/usr/local/go/src/cmd/compile/internal/noder/stencil.go:656 +0xf4
cmd/compile/internal/noder.(*genInst).scanForGenCalls.func1({0xe92798, 0xc00051bdd0?})
	/usr/local/go/src/cmd/compile/internal/noder/stencil.go:176 +0x2df
cmd/compile/internal/ir.Visit.func1({0xe92798, 0xc00051bdd0})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.doNodes(...)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:1512
cmd/compile/internal/ir.(*ReturnStmt).doChildren(0xe942f0?, 0xc00053d140)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:1049 +0x8c
cmd/compile/internal/ir.DoChildren(...)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0xe942f0, 0xc0000a4000})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes(...)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:1512
cmd/compile/internal/ir.(*Func).doChildren(0xe930f8?, 0xc00053d140?)
	/usr/local/go/src/cmd/compile/internal/ir/func.go:152 +0x6e
cmd/compile/internal/ir.DoChildren(...)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0xe930f8, 0xc00007e420})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0xe930f8, 0xc00007e420}, 0xc0003dd880)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/noder.(*genInst).scanForGenCalls(0x138ee00, {0xe930f8, 0xc00007e420})
	/usr/local/go/src/cmd/compile/internal/noder/stencil.go:158 +0x1f0
cmd/compile/internal/noder.(*genInst).buildInstantiations(0x138ee00, 0x1)
	/usr/local/go/src/cmd/compile/internal/noder/stencil.go:73 +0x85
cmd/compile/internal/noder.BuildInstantiations(...)
	/usr/local/go/src/cmd/compile/internal/noder/stencil.go:47
cmd/compile/internal/noder.(*irgen).generate(0xc0002f2240, {0xc0000ba430, 0x1, 0x203000?})
	/usr/local/go/src/cmd/compile/internal/noder/irgen.go:331 +0x3db
cmd/compile/internal/noder.check2({0xc0000ba430, 0x1, 0x1})
	/usr/local/go/src/cmd/compile/internal/noder/irgen.go:92 +0x16d
cmd/compile/internal/noder.LoadPackage({0xc0000be100, 0x1, 0x0?})
	/usr/local/go/src/cmd/compile/internal/noder/noder.go:90 +0x335
cmd/compile/internal/gc.Main(0xd4bd08)
	/usr/local/go/src/cmd/compile/internal/gc/main.go:191 +0xb13
main.main()
	/usr/local/go/src/cmd/compile/main.go:55 +0xdd
@ALTree
Copy link
Member

@ALTree ALTree commented Jan 7, 2022

cc @danscales

@ALTree ALTree added the NeedsInvestigation label Jan 7, 2022
@ALTree ALTree added this to the Go1.18 milestone Jan 7, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 7, 2022

A single file implementation of this code works, suggesting that there is some problem with the export data.

@danscales danscales self-assigned this Jan 8, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Jan 10, 2022

Change https://golang.org/cl/377494 mentions this issue: cmd/compile: fix the names of methods created during type substitution

jproberts pushed a commit to jproberts/go that referenced this issue Jun 21, 2022
The names given to methods of types created during type substitution
were possible incorrect when the type parameters themselves were nested
types.

Fixes golang#50485

Change-Id: I7e0043ed22c26406a5f9d8d51d9e928770a678f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/377494
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants