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

x/text: test failures with Go 1.8 on ppc64el #18808

Closed
mwhudson opened this issue Jan 27, 2017 · 4 comments
Closed

x/text: test failures with Go 1.8 on ppc64el #18808

mwhudson opened this issue Jan 27, 2017 · 4 comments

Comments

@mwhudson
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

$ /usr/lib/go-1.8/bin/go version
go version go1.8beta2 linux/ppc64le

(but it also happens with 1.8rc3)

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

ubuntu@diamond:~$ /usr/lib/go-1.8/bin/go env
GOARCH="ppc64le"
GOBIN=""
GOEXE=""
GOHOSTARCH="ppc64le"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ubuntu/go"
GORACE=""
GOROOT="/usr/lib/go-1.8"
GOTOOLDIR="/usr/lib/go-1.8/pkg/tool/linux_ppc64le"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build261703484=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

(It's Ubuntu 16.04)

What did you do?

$ /usr/lib/go-1.8/bin/go test golang.org/x/text/...

What did you expect to see?

Tests passing.

What did you see instead?

Tests failing (it's rather verbose, so see https://gist.github.com/mwhudson/81cf4b51fb2e6b0e516a812a864d3907)

The failing packages are:

FAIL	golang.org/x/text/collate	0.015s
FAIL	golang.org/x/text/internal/colltab	1.377s
FAIL	golang.org/x/text/search	0.003s

This only happens on ppc64el and only with Go 1.8, which is frankly a bit strange.

@mundaym
Copy link
Member

mundaym commented Jan 27, 2017

It looks like a 32-bit unsigned constant (0x80000000) is being sign extended to 64-bits before being compared with a 32-bit unsigned number (in a 64-bit unsigned comparison). It should instead be zero extended. From collelem.Elem.Primary():

ppc64le:

v17	00605 (src/golang.org/x/text/internal/colltab/collelem.go:208)	MOVWZ	"".ce(FP), R3
v7	00606 (src/golang.org/x/text/internal/colltab/collelem.go:208)	MOVD	$-2147483648, R4
v16	00607 (src/golang.org/x/text/internal/colltab/collelem.go:208)	CMPU	R3, R4
b1	00608 (src/golang.org/x/text/internal/colltab/collelem.go:208)	BLT	619

amd64: (note the 32-bit comparison)

v6	01152 (src/golang.org/x/text/internal/colltab/collelem.go:208)	MOVL	"".ce(FP), AX
v16	01153 (src/golang.org/x/text/internal/colltab/collelem.go:208)	CMPL	AX, $-2147483648
b1	01154 (src/golang.org/x/text/internal/colltab/collelem.go:208)	JCS	$0, 1164

I'll investigate further tomorrow unless someone beats me to it.

@mundaym
Copy link
Member

mundaym commented Jan 27, 2017

Found it, sent https://go-review.googlesource.com/#/c/35890/.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/35890 mentions this issue.

@mwhudson
Copy link
Contributor Author

Wow, thanks for the fast fix @mundaym

@golang golang locked and limited conversation to collaborators Jan 29, 2018
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