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/go: -coverpkg=all -race = signal: segmentation fault (core dumped) #23882

Closed
AlexRouSg opened this issue Feb 17, 2018 · 5 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@AlexRouSg
Copy link
Contributor

AlexRouSg commented Feb 17, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.10

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/chotepud/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="
/.local/go"
GOTMPDIR=""
GOTOOLDIR="~/.local/go/pkg/tool/linux_amd64"
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 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build941063065=/tmp/go-build -gno-record-gcc-switches"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

go test -race -coverpkg=all ./...

Content of test functions is irreverent, could be completely empty.

What did you expect to see?

Test run as normal

What did you see instead?

signal: segmentation fault (core dumped)
FAIL    github.com/AlexRouSg/test       0.110s
?       github.com/AlexRouSg/test/foo   [no test files]
@AlexRouSg AlexRouSg changed the title cmd/test: coverpkg=all + race = signal: segmentation fault (core dumped) cmd/test: -coverpkg=all -race = signal: segmentation fault (core dumped) Feb 17, 2018
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Feb 17, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.10.1 milestone Feb 17, 2018
@gopherbot
Copy link

Change https://golang.org/cl/94898 mentions this issue: cmd/go: if -race, don't run coverage on runtime packages

@ianlancetaylor ianlancetaylor changed the title cmd/test: -coverpkg=all -race = signal: segmentation fault (core dumped) cmd/go: -coverpkg=all -race = signal: segmentation fault (core dumped) Feb 17, 2018
@andybons
Copy link
Member

CL 94898 OK for Go 1.10.1

@andybons andybons reopened this Mar 27, 2018
@andybons andybons added CherryPickApproved Used during the release process for point releases and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 28, 2018
@gopherbot
Copy link

Change https://golang.org/cl/103095 mentions this issue: [release-branch.go1.10] cmd/go: if -race, don't run coverage on runtime packages

gopherbot pushed a commit that referenced this issue Mar 29, 2018
…me packages

Don't compile the runtime packages with coverage when using the race
detector. The user can, perhaps accidentally, request coverage for the
runtime by using -coverpkg=all. If using the race detector, the
runtime package coverage will call into the race detector before it
has been initialized. This will cause the program to crash
mysteriously on startup.

Fixes #23882

Change-Id: I9a63867a9138797d8b8afb0856ae21079accdb27
Reviewed-on: https://go-review.googlesource.com/94898
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-on: https://go-review.googlesource.com/103095
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@yonderblue
Copy link

Does this fix the issue if using -race along with an explicit -coverpkg list?
I am getting a list by doing the code equivalent of go list -f '{{.ImportPath}}' ./... | xargs | sed -e 's/ /,/g' and this issue popped up on go1.11.1 coming from go1.10.

@AlexRouSg
Copy link
Contributor Author

@Gaillard please make a new report as this issue is closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants