Skip to content

cmd/go: go test -race -covermode=set panics #20435

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

Closed
pierrre opened this issue May 20, 2017 · 2 comments
Closed

cmd/go: go test -race -covermode=set panics #20435

pierrre opened this issue May 20, 2017 · 2 comments

Comments

@pierrre
Copy link

pierrre commented May 20, 2017

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

tip (go version devel +15aa04d200 Fri May 19 20:15:10 2017 +0000 linux/amd64) and 1.8.1

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pierre/go"
GORACE=""
GOROOT="/home/pierre/.gimme/versions/go"
GOTOOLDIR="/home/pierre/.gimme/versions/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build110606031=/tmp/go-build -gno-record-gcc-switches"
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"

What did you do?

Run go test -race -covermode=set on my code.

Please note that go test -race runs without error on my code.

What did you expect to see?

go test documentation specifies for -covermode:

The default is "set" unless -race is enabled in which case it is "atomic".

The go test command should return an error if -race is used with -covermode=set.
Or it could also automatically set to atomic

What did you see instead?

It panics. (counters increment I presume)

@bradfitz bradfitz changed the title go test -race -covermode=set panics cmd/go: go test -race -covermode=set panics May 20, 2017
@bradfitz bradfitz added this to the Go1.9Maybe milestone May 20, 2017
@gopherbot
Copy link
Contributor

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

@pierrre
Copy link
Author

pierrre commented May 22, 2017

@Dhananjay92 thank you ! 👍

gopherbot pushed a commit that referenced this issue Jun 2, 2017

Verified

This commit was signed with the committer’s verified signature.
fpletz Franz Pletz
The test no longer passes as of https://golang.org/cl/43777, which
intentionally disables the feature that this test was checking for.
Nobody noticed since the test is not run in -short mode.

Updates #20435.

Change-Id: I64f37fd94c01f22ead88470b6d9bfe8a151ddb1c
Reviewed-on: https://go-review.googlesource.com/44650
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
@golang golang locked and limited conversation to collaborators May 22, 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