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 error missing type check #30907

Closed
jayconrod opened this issue Mar 18, 2019 · 7 comments
Closed

cmd/compile: internal error missing type check #30907

jayconrod opened this issue Mar 18, 2019 · 7 comments

Comments

@jayconrod
Copy link
Contributor

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

$ go version
go version devel +c0cfe9687f Thu Mar 14 21:00:20 2019 +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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jayconrod/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jayconrod/go"
GOPROXY=--redacted--
GORACE=""
GOROOT="/Users/jayconrod/Code/go"
GOTMPDIR=""
GOTOOLDIR="/Users/jayconrod/Code/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jayconrod/go/src/gocloud.dev/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rq/x0692kqj6ml8cvrhcqh5bswc008xj1/T/go-build259363876=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ cd ~/go/src
$ git clone https://github.com/google/go-cloud gocloud.dev
$ cd gocloud.dev
$ GO111MODULE=on go test -cover -coverpkg=./... ./blob/azureblob

What did you expect to see?

ok  	gocloud.dev/blob/azureblob	0.666s	coverage: 68.6% of statements in ./...

What did you see instead?

# gocloud.dev/blob/azureblob [gocloud.dev/blob/azureblob.test]
blob/azureblob/azureblob.go:535: internal compiler error: missing typecheck: 
.   AS l(536)
.   .   NAME-uuid..autotmp_1 a(true) l(14) x(0) class(PAUTO) tc(1) used uuid.UUID

goroutine 1 [running]:
runtime/debug.Stack(0x1c03f00, 0xc00009c000, 0x0)
	/Users/jayconrod/Code/go/src/runtime/debug/stack.go:24 +0x9d
cmd/compile/internal/gc.Fatalf(0x1a61921, 0x16, 0xc000b87450, 0x1, 0x1)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/subr.go:190 +0x293
cmd/compile/internal/gc.walkstmt(0xc0009a7a00, 0xc0009a7980)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:154 +0xe9a
cmd/compile/internal/gc.walkstmtlist(0xc000b92800, 0x2d, 0x40)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:79 +0x46
cmd/compile/internal/gc.walkstmt(0xc0005a8680, 0xc0005a8380)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:258 +0x132f
cmd/compile/internal/gc.walkstmtlist(0xc000b92600, 0x2d, 0x40)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:79 +0x46
cmd/compile/internal/gc.walk(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:63 +0x3e4
cmd/compile/internal/gc.compile(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/pgen.go:235 +0x80
cmd/compile/internal/gc.funccompile(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/pgen.go:221 +0xc2
cmd/compile/internal/gc.Main(0x1a7a1c8)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/main.go:665 +0x305a
main.main()
	/Users/jayconrod/Code/go/src/cmd/compile/main.go:51 +0xad

FAIL	gocloud.dev/blob/azureblob [build failed]
@jayconrod
Copy link
Contributor Author

A bisect pointed to CL 166983 as being the first bad commit on master. Seems related to the error.

@mdempsky @griesemer Mind taking a look?

@mdempsky mdempsky self-assigned this Mar 18, 2019
@mdempsky
Copy link
Member

mdempsky commented Mar 18, 2019

Minimal repro:

$ cat uuid/uuid.go
package uuid

type UUID string

func New() UUID {
	return Must(NewRandom())
}

func NewRandom() (UUID, error) {
	return "", nil
}

func Must(uuid UUID, err error) UUID {
	return uuid
}

$ cat p.go
package p

import "./uuid"

func f() {
	uuid.New()
}

$ GO111MODULE=off go build p.go
# command-line-arguments
./p.go:6:10: internal compiler error: missing typecheck: 
.   AS l(6)
.   .   NAME-uuid..autotmp_1 a(true) l(6) x(0) class(PAUTO) tc(1) used uuid.UUID

@gopherbot
Copy link

Change https://golang.org/cl/168199 mentions this issue: cmd/compile: fix importing rewritten f(g()) calls

@mdempsky
Copy link
Member

Thanks for the report, @jayconrod!

@jayconrod
Copy link
Contributor Author

Sure, thanks for fixing it so quickly!

@gopherbot
Copy link

Change https://golang.org/cl/195279 mentions this issue: cmd/go: fix link error for -coverpkg in GOPATH mode

gopherbot pushed a commit that referenced this issue Sep 13, 2019
If a generated test main package transitively depends on a main
package, the main package will now always be rebuilt as a library and
will not be compiled with '-p main'.

This expands the fix for #30907, which only applied to packages with
the BuildInfo set (main packages built in module mode). Linking
multiple packages with BuildInfo caused link errors, but it appears
these errors apply to some symbols in GOPATH mode.

Fixes #34114

Change-Id: Ic1e53437942269a950dd7e45d163707922c92edd
Reviewed-on: https://go-review.googlesource.com/c/go/+/195279
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/195281 mentions this issue: [release-branch.go1.13] cmd/go: fix link error for -coverpkg in GOPATH mode

gopherbot pushed a commit that referenced this issue Sep 25, 2019
…H mode

If a generated test main package transitively depends on a main
package, the main package will now always be rebuilt as a library and
will not be compiled with '-p main'.

This expands the fix for #30907, which only applied to packages with
the BuildInfo set (main packages built in module mode). Linking
multiple packages with BuildInfo caused link errors, but it appears
these errors apply to some symbols in GOPATH mode.

Fixes #34223

Change-Id: Ic1e53437942269a950dd7e45d163707922c92edd
Reviewed-on: https://go-review.googlesource.com/c/go/+/195279
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 24781a1)
Reviewed-on: https://go-review.googlesource.com/c/go/+/195281
@golang golang locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants