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: "truncation is not exact" ICE while compiling on ppc64le on QEMU #34139

Open
SuperQ opened this issue Sep 6, 2019 · 15 comments

Comments

@SuperQ
Copy link

commented Sep 6, 2019

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

$ go version
go version go1.13 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
GO111MODULE=""
GOARCH="ppc64le"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="ppc64le"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/peon/godev/go1.13/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/peon/godev/go1.13/go/pkg/tool/linux_ppc64le"
GCCGO="gccgo"
GOPPC64="power8"
AR="ar"
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-build688207401=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Building prometheus/node_exporter fails.

Running a Debian 9 (stretch) ppc64le QEMU VM on Debian 10 (buster) amd64 host.
QEMU 3.1 and 4.1 both produce the same compile error.

GO111MODULE=on /home/peon/.buildkite-agent/builds/debian-9-4-0-ppc64le-build-prometheus-io-1/prometheus/node-exporter-5b1a191e7471d00deeee08ce305d1de245243936-2122-nYyt/bin/promu --config .promu.yml build --prefix /home/peon/.buildkite-agent/builds/debian-9-4-0-ppc64le-build-prometheus-io-1/prometheus/node-exporter-5b1a191e7471d00deeee08ce305d1de245243936-2122-nYyt/src/github.com/prometheus/node_exporter
  | >   node_exporter
  | # runtime
  | /home/peon/godev/go/src/runtime/runtime1.go:162:22: internal compiler error: 'check': panic during opt while compiling check:
  |  
  | truncate64Fto32F: truncation is not exact
  |  
  | goroutine 129 [running]:
  | cmd/compile/internal/ssa.Compile.func1(0xc0023aefa8, 0xc003c78f20)
  | /usr/local/go/src/cmd/compile/internal/ssa/compile.go:47 +0x9c
  | panic(0x8c63a0, 0xaf8740)
  | /usr/local/go/src/runtime/panic.go:679 +0x1bc
  | cmd/compile/internal/ssa.truncate64Fto32F(0xc7ffffffe0000000, 0xc000000852)
  | /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:444 +0xdc
  | cmd/compile/internal/ssa.auxTo32F(...)
  | /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:494
  | cmd/compile/internal/ssa.rewriteValuegeneric_OpEq32F_0(0xc00255ae58, 0xffffffffffffff01)
  | /usr/local/go/src/cmd/compile/internal/ssa/rewritegeneric.go:19739 +0x128
  | cmd/compile/internal/ssa.rewriteValuegeneric(0xc00255ae58, 0x0)
  | /usr/local/go/src/cmd/compile/internal/ssa/rewritegeneric.go:105 +0x18dc
  | cmd/compile/internal/ssa.applyRewrite(0xc003c78f20, 0x96be28, 0x96bea0)
  | /usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:80 +0x538
  | cmd/compile/internal/ssa.opt(0xc003c78f20)
  | /usr/local/go/src/cmd/compile/internal/ssa/opt.go:9 +0x44
  | cmd/compile/internal/ssa.Compile(0xc003c78f20)
  | /usr/local/go/src/cmd/compile/internal/ssa/compile.go:92 +0x8a4
  | cmd/compile/internal/gc.buildssa(0xc0016f2840, 0x1, 0x0)
  | /usr/local/go/src/cmd/compile/internal/gc/ssa.go:289 +0x778
  | cmd/compile/internal/gc.compileSSA(0xc0016f2840, 0x1)
  | /usr/local/go/src/cmd/compile/internal/gc/pgen.go:298 +0x38
  | cmd/compile/internal/gc.compileFunctions.func2(0xc0026f4480, 0xc000501280, 0x1)
  | /usr/local/go/src/cmd/compile/internal/gc/pgen.go:363 +0x40
  | created by cmd/compile/internal/gc.compileFunctions
  | /usr/local/go/src/cmd/compile/internal/gc/pgen.go:361 +0x12c
  |  
  |  
  |  
  | Please file a bug report including a short program that triggers the error.
  | https://golang.org/issue/new
  | !! command failed: build -o /home/peon/.buildkite-agent/builds/debian-9-4-0-ppc64le-build-prometheus-io-1/prometheus/node-exporter-5b1a191e7471d00deeee08ce305d1de245243936-2122-nYyt/src/github.com/prometheus/node_exporter/node_exporter -ldflags -X github.com/prometheus/common/version.Version=0.18.1 -X github.com/prometheus/common/version.Revision=non-git -X github.com/prometheus/common/version.Branch=non-git -X github.com/prometheus/common/version.BuildUser=peon@debian-9-4-0-ppc64le.build.prometheus.io -X github.com/prometheus/common/version.BuildDate=20190906-08:37:12  -extldflags '-static' -mod=vendor -a -tags 'netgo static_build' github.com/prometheus/node_exporter: exit status 2

@ALTree ALTree added this to the Go1.14 milestone Sep 6, 2019

@ALTree ALTree changed the title cmd/compile: "truncation is not exact" ICE while compiling docker on ppc64le cmd/compile: "truncation is not exact" ICE while compiling docker on ppc64le on QEMU Sep 6, 2019

@ALTree

This comment has been minimized.

Copy link
Member

commented Sep 6, 2019

Thanks for opening this. I've changed the title to clarify that this issue is only reproducible when emulating a ppc64le system on QEMU, since this a (possibly) relevant piece of information.

Feel free to speak up if I'm mistaken and this is also reproducible outside of QEMU.

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 6, 2019

Looks fine, thanks. I don't have any ppc64le hardware to reproduce on.

@SuperQ SuperQ changed the title cmd/compile: "truncation is not exact" ICE while compiling docker on ppc64le on QEMU cmd/compile: "truncation is not exact" ICE while compiling on ppc64le on QEMU Sep 8, 2019

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

If you had a short reproducer program or better directions on how to get to the failure I could try it on ppc64le.

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 10, 2019

Just running make build on https://github.com/prometheus/node_exporter should do it.

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

node_exporter built successfully on all variations I tried: Debian 9 power8 and SLES power9. On the power8 I compiled using go from Go 1.13 and upstream on hardware, not QEMU.

This must have built successfully in Go 1.12?

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 10, 2019

@laboger Are you using a QEMU ppc64le guest VM? What version of QEMU?

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

I am not using QEMU. I only tried it on ppc64le hardware.

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 10, 2019

This issue is about QEMU.

@ALTree

This comment has been minimized.

Copy link
Member

commented Sep 10, 2019

This issue is about QEMU.

I mean... we weren't sure. Now we (more or less) are. Thanks @laboger for testing on real hardware.

My question now is... is this a QEMU bug? It could be. After all, Go produces binaries that work on real ppc64le hardware.

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

Yes, I know now but based on what was written earlier I didn't think it was known to be QEMU only for sure.

Is this a new failure in Go 1.13?

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 11, 2019

The problem appeared when upgrading from QEMU 2.8 (Debian 9) to QEMU 3.1 (Debian 10).

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

I've received information that there were some recent fixes to QEMU for ppc64le related to float conversions that will be in QEMU 4.2. The person who gave me this information was able to do a build of node_exporter successfully using QEMU built from upstream.

@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 11, 2019

Great! Looking forward to testing that. Can you link to the patch here?

@laboger

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

Here is the merge commit that includes the fixes:

Merge: 3483534 b1e8156
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Tue Sep 3 17:20:39 2019 +0100
    Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20190829' into staging
    
    ppc patch queue 2018-08-29
    
    Another pull request for ppc-for-4.2.  Includes
    
      * Several powernv patches which were pulled last minute from the
        last PULL, now that some problems with them have been sorted out
      * A fix for -no-reboot which has been broken since the
        pseries-rhel4.1.0 machine type
      * Add some host threads information which AIX guests will need to
        properly scale the PURR and SPURR
      * Change behaviour to match x86 when unplugging function 0 of a
        multifunction PCI device
      * A number of TCG fixes in FPU emulation
    
    And a handful of other assorted fixes and cleanups.
@SuperQ

This comment has been minimized.

Copy link
Author

commented Sep 11, 2019

Thanks, I wonder if we can get this patch backported by Debian into Buster. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.