Skip to content

cmd/compile: unexpected error about conflicting package heights  #25568

@ysmolski

Description

@ysmolski

While trying to remove use of perl from test/fixedbugs/bug345.go, I have encountered following behaviour about conflicting package heights.

cd go/test
go tool compile -e -D . -I . fixedbugs/bug345.dir/io.go
go tool compile -e -D . -I . fixedbugs/bug345.dir/main.go
fixedbugs/bug345.dir/main.go:9:2: internal compiler error: conflicting package heights 4 and 0 for path "io"

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/Users/thorn/golang/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0x18bdf99, 0x31, 0xc000333038, 0x3, 0x3)
	/Users/thorn/golang/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.iimport(0xc000086730, 0xc00006cbd0)
	/Users/thorn/golang/src/cmd/compile/internal/gc/iimport.go:156 +0xc71
cmd/compile/internal/gc.importfile(0xc000333578, 0x0)
	/Users/thorn/golang/src/cmd/compile/internal/gc/main.go:1128 +0xb63
cmd/compile/internal/gc.(*noder).importDecl(0xc00032a090, 0xc00006f6e0)
	/Users/thorn/golang/src/cmd/compile/internal/gc/noder.go:285 +0x7c
cmd/compile/internal/gc.(*noder).decls(0xc00032a090, 0xc0003485c0, 0x4, 0x4, 0xc0000622f8, 0xc00033170d, 0xc000024500)
	/Users/thorn/golang/src/cmd/compile/internal/gc/noder.go:261 +0x174
cmd/compile/internal/gc.(*noder).node(0xc00032a090)
	/Users/thorn/golang/src/cmd/compile/internal/gc/noder.go:239 +0xbd
cmd/compile/internal/gc.parseFiles(0xc000088060, 0x1, 0x1, 0x2)
	/Users/thorn/golang/src/cmd/compile/internal/gc/noder.go:57 +0x36f
cmd/compile/internal/gc.Main(0x18c42e0)
	/Users/thorn/golang/src/cmd/compile/internal/gc/main.go:468 +0x1c38
main.main()
	/Users/thorn/golang/src/cmd/compile/main.go:51 +0x96

https://github.com/golang/go/blob/master/test/fixedbugs/bug345.dir/io.go
https://github.com/golang/go/blob/master/test/fixedbugs/bug345.dir/main.go

I am not sure if it's a bug or expected feature.

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

go version devel +30b6bc30b2 Thu May 24 22:08:00 2018 +0000 darwin/amd64

OARCH="amd64"
GOBIN=""
GOCACHE="/Users/thorn/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/thorn/go"
GORACE=""
GOROOT="/Users/thorn/golang"
GOTMPDIR=""
GOTOOLDIR="/Users/thorn/golang/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/km/50gy6_q557v6_7vxbf9b29v00000gn/T/go-build645753215=/tmp/go-build -gno-record-gcc-switches -fno-common"

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions