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 #49094

Closed
johejo opened this issue Oct 21, 2021 · 2 comments
Closed

cmd/compile: internal compiler error: missing import reader #49094

johejo opened this issue Oct 21, 2021 · 2 comments
Labels
NeedsFix
Milestone

Comments

@johejo
Copy link

@johejo johejo commented Oct 21, 2021

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

$ go version
go version devel go1.18-fca46d0b36 Thu Oct 21 02:35:47 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

No, tip only

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mitsuo.heijo/Library/Caches/go-build"
GOENV="/Users/mitsuo.heijo/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/mitsuo.heijo/go/pkg/mod"
GONOPROXY="github.com/blue-agency"
GONOSUMDB="github.com/blue-agency"
GOOS="darwin"
GOPATH="/Users/mitsuo.heijo/go"
GOPRIVATE="github.com/blue-agency"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/mitsuo.heijo/ghq/github.com/golang/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/mitsuo.heijo/ghq/github.com/golang/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-fca46d0b36 Thu Oct 21 02:35:47 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mitsuo.heijo/ghq/github.com/go-gorm/mysql/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/50/pygqcybx6hvgqkw7bkqfh5qm0000gp/T/go-build21491630=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

git clone https://github.com/go-gorm/mysql.git
cd mysql/
go build ./...

What did you expect to see?

build succeeds

What did you see instead?

# gorm.io/driver/mysql
<autogenerated>:1: internal compiler error: missing import reader for regexp.(*Regexp).doMatch

goroutine 1 [running]:
runtime/debug.Stack()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x18665c0, 0x0}, {0x18f310c, 0x1c}, {0xc00061b340, 0x1, 0x1})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/typecheck.ImportBody(0xc000e0e160)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/iimport.go:73 +0x1b9
cmd/compile/internal/typecheck.ImportedBody(0xc000e0e160)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/func.go:169 +0xad
cmd/compile/internal/typecheck.(*crawler).markInlBody(0xc000fd70c0, 0x610886895506ef0f)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:193 +0x187
cmd/compile/internal/typecheck.(*crawler).markObject(0x1866800, 0xc000e06b60)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:37 +0x2f
cmd/compile/internal/typecheck.(*crawler).markEmbed(0xc000fd70c0, 0x1010df6)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:157 +0x16f
cmd/compile/internal/typecheck.(*crawler).markInlBody.func1({0x1a41d20, 0xc000875500})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:220 +0x94
cmd/compile/internal/ir.Visit.func1({0x1a41d20, 0xc000875500})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.doNodes({0xc00088cc80, 0x4, 0xc000fd70c0}, 0xc000a54570)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc000e13b00, 0xc000a54570)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:263 +0x85
cmd/compile/internal/ir.DoChildren(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40678, 0xc000e13b00})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc000115ee0, 0x1, 0xc000a54570}, 0xc000a54570)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*ReturnStmt).doChildren(0xc000e448c0, 0xc000e448c0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:1049 +0x57
cmd/compile/internal/ir.DoChildren(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a421d0, 0xc000e448c0})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a421d0, 0xc000e448c0}, 0xc000a54558)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.VisitList({0xc000115ec0, 0x1, 0xc00089eaf0}, 0xc000382ee0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:114 +0x65
cmd/compile/internal/typecheck.(*crawler).markInlBody(0xc000fd70c0, 0xee1c81f7cf6099b4)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:249 +0x21b
cmd/compile/internal/typecheck.(*crawler).markObject(0x1866800, 0xc00088bad0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:37 +0x2f
cmd/compile/internal/typecheck.(*crawler).markEmbed(0xc000fd70c0, 0xc00088a750)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:157 +0x16f
cmd/compile/internal/typecheck.(*crawler).markEmbed(0xc000fd70c0, 0x1881b20)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:165 +0x151
cmd/compile/internal/typecheck.(*crawler).markObject(0xc00063f260, 0xc0008c1450)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:43 +0x4b
cmd/compile/internal/typecheck.crawlExports({0xc000855b00, 0xc, 0x10dd833})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:25 +0x9f
cmd/compile/internal/typecheck.WriteExports({0x1a3ad60, 0xc000c0a900}, 0x1)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/iexport.go:303 +0x65
cmd/compile/internal/noder.WriteExports(0xc000fd6ff0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/noder/export.go:40 +0x7a
cmd/compile/internal/gc.dumpCompilerObj(0xc000fd6ff0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:107 +0x28
cmd/compile/internal/gc.dumpobj1({0x7ffeefbfe936, 0x4f}, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:63 +0x17b
cmd/compile/internal/gc.dumpobj()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:44 +0x36
cmd/compile/internal/gc.Main(0x190f8c0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/main.go:334 +0x1136
main.main()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/main.go:55 +0xdd

If the minimum reproduction is found, I report it additionally.

@johejo johejo changed the title cmd/compile: internal compiler error: missing import reader for regexp.(*Regexp).doMatch cmd/compile: internal compiler error: missing import reader Oct 21, 2021
@johejo
Copy link
Author

@johejo johejo commented Oct 21, 2021

Other reproduction package

https://github.com/owenrumney/squealer

# github.com/owenrumney/squealer/pkg/squealer
<autogenerated>:1: internal compiler error: missing import reader for mertics.(*Metrics).IncrementCommitsProcessed

goroutine 1 [running]:
runtime/debug.Stack()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x631430, 0xc0}, {0x18f310c, 0x1c}, {0xc000631450, 0x1, 0x1})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/typecheck.ImportBody(0xc0000a5b80)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/iimport.go:73 +0x1b9
cmd/compile/internal/typecheck.ImportedBody(0xc0000a5b80)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/func.go:169 +0xad
cmd/compile/internal/typecheck.(*crawler).markInlBody(0xc0007185a0, 0xfcd7324d3c7df93c)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:193 +0x187
cmd/compile/internal/typecheck.(*crawler).markObject(0x1866800, 0xc0000a3040)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:37 +0x2f
cmd/compile/internal/typecheck.(*crawler).markEmbed(0xc0007185a0, 0xc0000ca180)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:157 +0x16f
cmd/compile/internal/typecheck.(*crawler).markInlBody.func1({0x1a41d20, 0xc0008c6100})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:220 +0x94
cmd/compile/internal/ir.Visit.func1({0x1a41d20, 0xc0008c6100})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.doNodes({0xc000616180, 0x3, 0xc0007185a0}, 0xc0004ae510)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc000620000, 0xc0004ae510)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:263 +0x85
cmd/compile/internal/ir.DoChildren(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40678, 0xc000620000})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.(*AssignStmt).doChildren(0xc00061c050, 0xc0004ae510)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/node_gen.go:152 +0x82
cmd/compile/internal/ir.DoChildren(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0x1a40290, 0xc00061c050})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0x1a40290, 0xc00061c050}, 0xc0004ae4f8)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.VisitList({0xc00061e000, 0x2, 0xc0008c4700}, 0xa9bc7fa4d2d15ba0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ir/visit.go:114 +0x65
cmd/compile/internal/typecheck.(*crawler).markInlBody(0xc0007185a0, 0x1881b20)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:249 +0x21b
cmd/compile/internal/typecheck.(*crawler).markObject(0xc000542330, 0xc0008ade10)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:37 +0x2f
cmd/compile/internal/typecheck.crawlExports({0xc0008b3500, 0x4, 0x10dd833})
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/crawler.go:25 +0x9f
cmd/compile/internal/typecheck.WriteExports({0x1a3ad60, 0xc00083e060}, 0x1)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/typecheck/iexport.go:303 +0x65
cmd/compile/internal/noder.WriteExports(0xc0007184f0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/noder/export.go:40 +0x7a
cmd/compile/internal/gc.dumpCompilerObj(0xc0007184f0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:107 +0x28
cmd/compile/internal/gc.dumpobj1({0x7ffeefbfe926, 0x50}, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:63 +0x17b
cmd/compile/internal/gc.dumpobj()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/obj.go:44 +0x36
cmd/compile/internal/gc.Main(0x190f8c0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/main.go:334 +0x1136
main.main()
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/main.go:55 +0xdd

@cuonglm cuonglm added the NeedsFix label Oct 21, 2021
@cuonglm cuonglm added this to the Go1.18 milestone Oct 21, 2021
@cuonglm cuonglm self-assigned this Oct 21, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 21, 2021

Change https://golang.org/cl/357232 mentions this issue: cmd/compile: only look for struct type during inlining

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants