Skip to content

cmd/compile: "truncation is not exact" ICE while compiling docker on ppc64le  #32148

@DanielCasali

Description

@DanielCasali

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

$ go version
[root@powericp compile]# go version
go version go1.12.5 linux/ppc64le

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GOARCH="ppc64le"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="ppc64le"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_ppc64le"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build479939429=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Installed CentOS ppc64le on a virtual machine hosted on a Fedora 30 amd64 qemu-system-ppc-3.1.0-8.fc30.x86_64 and libvirt-5.1.0-5.fc30.x86_64
server installs correctly and everything works, only programs compiled with go seem to be affected.
I could not run a docker container from distribution:

[root@powericp ~]# docker run -i -t alpine /bin/sh
/usr/bin/docker-current: Error response from daemon: oci runtime error: error running hook: exit status 4, stdout: , stderr: fatal error: float32nan
runtime: panic before malloc heap initialized

runtime stack:
fatal error: gentraceback before goexitPC initialization
runtime: panic before malloc heap initialized
panic during panic

runtime stack:
fatal error: gentraceback before goexitPC initialization
runtime: panic before malloc heap initialized
stack trace unavailable.

I decided to recompile docker since this works on a non emulated ppc64le followed:
https://github.com/moby/moby/blob/master/project/PACKAGERS.md
to get a minimal docker build that would run containers on ppc64le.

What did you expect to see?

docker built

What did you see instead?

/usr/local/go/src/runtime/runtime1.go:162:22: internal compiler error: 'check': panic during opt while compiling check:

truncate64Fto32F: truncation is not exact

goroutine 1 [running]:
cmd/compile/internal/ssa.Compile.func1(0xc000728810, 0xc008c5dce0)
        /usr/local/go/src/cmd/compile/internal/ssa/compile.go:45 +0x9c
panic(0x8fdbe0, 0xb49240)
        /usr/local/go/src/runtime/panic.go:522 +0x1c8
cmd/compile/internal/ssa.truncate64Fto32F(0xc7ffffffe0000000, 0xc000000802)
        /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:444 +0xf4
cmd/compile/internal/ssa.auxTo32F(...)
        /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:494
cmd/compile/internal/ssa.rewriteValuegeneric_OpEq32F_0(0xc002a582d0, 0xc002a87b01)
        /usr/local/go/src/cmd/compile/internal/ssa/rewritegeneric.go:9494 +0x144
cmd/compile/internal/ssa.rewriteValuegeneric(0xc002a582d0, 0x0)
        /usr/local/go/src/cmd/compile/internal/ssa/rewritegeneric.go:105 +0x15f4
cmd/compile/internal/ssa.applyRewrite(0xc008c5dce0, 0x9b2698, 0x9b2700)
        /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:80 +0x564
cmd/compile/internal/ssa.opt(0xc008c5dce0)
        /usr/local/go/src/cmd/compile/internal/ssa/opt.go:9 +0x44
cmd/compile/internal/ssa.Compile(0xc008c5dce0)
        /usr/local/go/src/cmd/compile/internal/ssa/compile.go:90 +0x4a8
cmd/compile/internal/gc.buildssa(0xc001b6d760, 0x0, 0x0)
        /usr/local/go/src/cmd/compile/internal/gc/ssa.go:233 +0x790
cmd/compile/internal/gc.compileSSA(0xc001b6d760, 0x0)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:299 +0x38
cmd/compile/internal/gc.compile(0xc001b6d760)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:278 +0x298
cmd/compile/internal/gc.funccompile(0xc001b6d760)
        /usr/local/go/src/cmd/compile/internal/gc/pgen.go:221 +0xec
cmd/compile/internal/gc.Main(0x9b2498)
        /usr/local/go/src/cmd/compile/internal/gc/main.go:665 +0x3204
main.main()
        /usr/local/go/src/cmd/compile/main.go:51 +0xbc



Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

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.arch-ppc64x

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions