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: missing import reader for sync.(*Once).Do . #49143

Closed
nzlov opened this issue Oct 25, 2021 · 8 comments
Closed
Assignees
Milestone

Comments

@nzlov
Copy link

@nzlov nzlov commented Oct 25, 2021

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

$ go version
go version devel go1.18-9ff91b9098 Fri Oct 22 00:57:18 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

no

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jincai/Library/Caches/go-build"
GOENV="/Users/jincai/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jincai/workspaces/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jincai/workspaces/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/jincai/program/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/jincai/program/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-9ff91b9098 Fri Oct 22 00:57:18 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jincai/workspaces/jincai/jincai/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8p/jydpmkt57bg0crgv50pf52gc0000gn/T/go-build1108979311=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Sorry, I can't implement the smallest example. But I found the wrong submission.

What did you expect to see?

build succeeds

What did you see instead?

/Users/jincai/workspaces/go/pkg/mod/github.com/nzlov/dataloader@v0.0.0-20211021075507-b0b05ed370ce/loader.go:257:10: internal compiler error: missing import reader for sync.(*Once).Do

goroutine 1 [running]:
runtime/debug.Stack()
	/Users/jincai/program/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x1866b80, 0x0}, {0x18f3743, 0x1c}, {0xc00142e540, 0x1, 0x1})
	/Users/jincai/program/go/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/Users/jincai/program/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/typecheck.ImportBody(0xc001b49760)
	/Users/jincai/program/go/src/cmd/compile/internal/typecheck/iimport.go:73 +0x1b9
cmd/compile/internal/typecheck.ImportedBody(0xc001b49760)
	/Users/jincai/program/go/src/cmd/compile/internal/typecheck/func.go:169 +0xad
cmd/compile/internal/inline.oldInline(0xc0026719e0, 0xc001b49760, 0x0)
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:781 +0x53
cmd/compile/internal/inline.mkinlcall(0xc0026719e0, 0xc001b49760, 0x11b8634, 0xc000c0ce40, 0xc0021e9ee0)
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:733 +0xc85
cmd/compile/internal/inline.inlnode({0x1a40c58, 0xc0026719e0}, 0x20, 0x30, 0x2050108)
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:590 +0x4e5
cmd/compile/internal/inline.InlineCalls.func1({0x1a40c58, 0xc0026719e0})
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:509 +0x31
cmd/compile/internal/ir.editNodes({0xc002663810, 0x1, 0x189ca80}, 0xc0021e9ee0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1521 +0x74
cmd/compile/internal/ir.(*Func).editChildren(0xc00142ec58, 0x11b7e87)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:153 +0x2e
cmd/compile/internal/ir.EditChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:185
cmd/compile/internal/inline.InlineCalls(0xc0026006e0)
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:511 +0xf2
cmd/compile/internal/inline.InlinePackage.func1({0xc001127470, 0x2, 0xc0026006e0}, 0x0)
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:71 +0x46
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc0026006e0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:127 +0x2f0
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func1({0x1a415b8, 0xc0026006e0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:81 +0x45
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func2({0x1a42238, 0xc0026c0dd0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:91 +0x7e
cmd/compile/internal/ir.Visit.func1({0x1a42238, 0xc0026c0dd0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc002671290, 0xc0022642a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc002671290})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc002666ff0, 0x3, 0x189ca80}, 0xc0022642a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*IfStmt).doChildren(0xc0026c7490, 0xc0022642a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:641 +0x85
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a418d8, 0xc0026c7490})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0026792e0, 0x2, 0x0}, 0xc0022642a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0x1a415b8, 0xc002600420)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a415b8, 0xc002600420})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a415b8, 0xc002600420}, 0xc00111f910)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc002600420)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:87 +0x1c8
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func1({0x1a415b8, 0xc002600420})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:81 +0x45
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func2({0x1a42238, 0xc0026c0680})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:91 +0x7e
cmd/compile/internal/ir.Visit.func1({0x1a42238, 0xc0026c0680})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc002670b40, 0xc002264270)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc002670b40})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*GoDeferStmt).doChildren(0xc0010acf40, 0xc002264270)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:598 +0x62
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a41748, 0xc0010acf40})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0026633e0, 0x1, 0xd40000011bb097}, 0xc002264270)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*IfStmt).doChildren(0xc0026b9e30, 0xc002264270)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:641 +0x85
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a418d8, 0xc0026b9e30})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc002672a80, 0x6, 0x0}, 0xc002264270)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0x1a415b8, 0xc002600160)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a415b8, 0xc002600160})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a415b8, 0xc002600160}, 0xc00111f900)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc002600160)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:87 +0x1c8
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func1({0x1a415b8, 0xc002600160})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:81 +0x45
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func2({0x1a42238, 0xc002675040})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:91 +0x7e
cmd/compile/internal/ir.Visit.func1({0x1a42238, 0xc002675040})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc0026d53b0, 0xc002264168)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc0026d53b0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*AssignStmt).doChildren(0xc0026e12c0, 0xc002264168)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:152 +0x82
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40870, 0xc0026e12c0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0026e0af0, 0x5, 0x0}, 0xc002264168)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0x1a415b8, 0xc002601340)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a415b8, 0xc002601340})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a415b8, 0xc002601340}, 0xc00111f7a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc002601340)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:87 +0x1c8
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func1({0x1a415b8, 0xc002601340})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:81 +0x45
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func2({0x1a42238, 0xc0026d7860})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:91 +0x7e
cmd/compile/internal/ir.Visit.func1({0x1a42238, 0xc0026d7860})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc0026d4480, 0xc002264138)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc0026d4480})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc0026d43f0, 0xc002264138)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc0026d43f0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc002663b90, 0x1, 0xc0006ecae0}, 0xc002264138)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*AssignListStmt).doChildren(0xc002673ec0, 0xc002673ec0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:100 +0x7f
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a406e0, 0xc002673ec0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc002663bc0, 0x1, 0xc00142f770}, 0xc002264138)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*ReturnStmt).doChildren(0xc0026cee60, 0xc0026cee60)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1046 +0x38
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a427b0, 0xc0026cee60})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc002663b20, 0x1, 0x0}, 0xc002264138)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0x1a415b8, 0xc002600c60)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a415b8, 0xc002600c60})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a415b8, 0xc002600c60}, 0xc00111f780)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc002600c60)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:87 +0x1c8
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func1({0x1a415b8, 0xc002600c60})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:81 +0x45
cmd/compile/internal/ir.(*bottomUpVisitor).visit.func2({0x1a42238, 0xc0026c1ee0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:91 +0x7e
cmd/compile/internal/ir.Visit.func1({0x1a42238, 0xc0026c1ee0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc001a60360, 0xc002264108)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40c58, 0xc001a60360})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0013aba80, 0x1, 0x0}, 0xc002264108)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*AssignListStmt).doChildren(0xc0006ed7a0, 0xc0006ed7a0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:100 +0x7f
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a406e0, 0xc0006ed7a0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0013abab0, 0x1, 0xc00142fa98}, 0xc002264108)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*ReturnStmt).doChildren(0xc001d10f00, 0xc001d10f00)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1046 +0x38
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a427b0, 0xc001d10f00})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0013abac0, 0x1, 0x0}, 0xc002264108)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0x1a415b8, 0xc0017c58c0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a415b8, 0xc0017c58c0})
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a415b8, 0xc0017c58c0}, 0xc00111f730)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.(*bottomUpVisitor).visit(0xc000c0cb10, 0xc0017c58c0)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:87 +0x1c8
cmd/compile/internal/ir.VisitFuncsBottomUp({0xc0029d2000, 0x2b3, 0xb}, 0x1910088)
	/Users/jincai/program/go/src/cmd/compile/internal/ir/scc.go:60 +0x105
cmd/compile/internal/inline.InlinePackage()
	/Users/jincai/program/go/src/cmd/compile/internal/inline/inl.go:58 +0x33
cmd/compile/internal/gc.Main(0x190ff38)
	/Users/jincai/program/go/src/cmd/compile/internal/gc/main.go:246 +0xc7d
main.main()
	/Users/jincai/program/go/src/cmd/compile/main.go:55 +0xdd

Cause:

#49094
cmd/compile: only look for struct type when crawling inline body 9ff91b9

@nzlov
Copy link
Author

@nzlov nzlov commented Oct 25, 2021

Fix:

diff --git a/src/cmd/compile/internal/typecheck/crawler.go b/src/cmd/compile/internal/typecheck/crawler.go
index e1489ceedd..eea86d38e0 100644
--- a/src/cmd/compile/internal/typecheck/crawler.go
+++ b/src/cmd/compile/internal/typecheck/crawler.go
@@ -224,6 +224,9 @@ func (p *crawler) markInlBody(n *ir.Name) {
                                                }
                                        }
                                }
+                               if t.IsPtr() {
+                                       p.markEmbed(t)
+                               }
                        }
                }

Maybe need t.IsPtrElem()?

Loading

@cuonglm cuonglm self-assigned this Oct 25, 2021
@cuonglm cuonglm added this to the Go1.18 milestone Oct 25, 2021
@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 25, 2021

Would you mind providing what repo causes this ICE? I tried git clone https://github.com/nzlov/dataloader.git then building successfully.

Loading

@nzlov
Copy link
Author

@nzlov nzlov commented Oct 25, 2021

Sorry. Company project cannot be provided.

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 25, 2021

Sorry. Company project cannot be provided.

So to clarify, you get this error when importing github.com/nzlov /dataloader? Would you describe how did you use dataloader.{Loader,Config} in the package that import them?

Loading

@nzlov
Copy link
Author

@nzlov nzlov commented Oct 26, 2021

@cuonglm demo
only go run ./server.go

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 26, 2021

@nzlov Thanks for the reproducible program. I was able to write a much smaller one, and have a fix in my local.

The problem was existed before 9ff91b9, and un-intentionally fixed in 4e565f7 (If you built the toolchain with commit 27a1454, you will see the same crash).

Loading

@nzlov
Copy link
Author

@nzlov nzlov commented Oct 26, 2021

@cuonglm Thanks.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 26, 2021

Change https://golang.org/cl/358814 mentions this issue: cmd/compile: fix generic type handling when crawling inline body

Loading

@gopherbot gopherbot closed this in ca5f65d Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants