-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: many tests on s390x fail when -covermode=atomic is used #24449
Comments
-covermode="atomic"
is used
Could you provide a self-contained piece of code or test that reproduces this problem? Ideally much smaller than |
Here is a small testcase: go-test-coverage-atomic-s390x.tar.gz I extracted a scanner module from our spdx parser. Its a bit of a random example but it is pretty small. I also simplified the testcase to use no external libs (it used to use gocheck.v1) and only a single trivial test input. When I run it on a s390x:
What is interessting is that if I add a debug line into the scanner.go code like this:
this produces:
The last line looks suspicious - go-test-coverage-atomic-s390x-with-debug.tar.gz I also added the debug enabled script. But this is just one instance of the failure, we see many more so it seems like something fundamental is wrong with coverage=atomic. |
I've seen a couple of these "code isn't working as expected" before, and they tend to be compiler issues. This one likely has something to do with its s390x support. Have you been able to try tip, i.e. the master branch? /cc @mundaym |
I had a quick look. I think the issue is that the |
I tested with:
and see the same issue. |
Change https://golang.org/cl/101455 mentions this issue: |
Reopening for backport to Go 1.10.1. |
@mvo5 Thanks for the report, the issue should now be fixed at tip. Are you able to confirm? |
Thanks for the super quick fix. I can confirm the fix works:
|
CL 101455 OK for Go 1.10.1 |
Change https://golang.org/cl/102788 mentions this issue: |
…flags on s390x The atomic add instructions modify the condition code and so need to be marked as clobbering flags. Fixes #24449. Change-Id: Ic69c8d775fbdbfb2a56c5e0cfca7a49c0d7f6897 Reviewed-on: https://go-review.googlesource.com/101455 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/102788 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Michael Munday <mike.munday@ibm.com>
What version of Go are you using (
go version
)?The problematic behaviour is shown by:
go1.10 linux/s390x
I also tested with go1.9 and go1.8 (from the go snap) and that works fine. Happy to
test more versions.
Does this issue reproduce with the latest release?
I have not tested master but it does reproduce with 1.10.
What operating system and processor architecture are you using (
go env
)?GOARCH="s390x"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOEXE=""
GOHOSTARCH="s390x"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ubuntu/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_s390x"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -march=z196 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build233531017=/tmp/go-build -gno-record-gcc-switches"
What did you do?
On the s390x (with Ubuntu 18.04 (bionic)) many tests for our "snapd" project fail when using -covermode="atomic" but work fine with set other cover modes. A simple example:
What did you expect to see?
I was expecting the test to work regardless of the covermode. The covermodes "set" and "count" are fine, only with "atomic" things break.
What did you see instead?
Same output regardless of
-covermode=
setting.[edit: typos]
The text was updated successfully, but these errors were encountered: