Skip to content

runtime/race: setting cap_net_bind_service or cap_net_raw capabilities disables halt_on_error #59434

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
ainar-g opened this issue Apr 4, 2023 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. RaceDetector
Milestone

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Apr 4, 2023

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

$ go version
go version go1.20.2 linux/amd64

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="amd64"
GOBIN=""
GOCACHE="/home/ainar/.cache/go-build"
GOENV="/home/ainar/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ainar/go/pkg/mod"
GONOPROXY="REMOVED"
GONOSUMDB="REMOVED"
GOOS="linux"
GOPATH="/home/ainar/go"
GOPRIVATE="REMOVED"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/ainar/go/go1.20"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/ainar/go/go1.20/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/home/ainar/dev/tmp/go/tmp/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2426973317=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package main

import (
	"fmt"
	"time"
)

func main() {
	for i := 0; i < 100; i++ {
		go f(&i)
	}

	time.Sleep(1 * time.Second)

	fmt.Println("the end")
}

func f(p *int) {
	fmt.Println(*p)
}
GORACE='atexit_sleep_ms=0 halt_on_error=1'
export GORACE

go build --race -o tmp_with_setcap
sudo setcap 'cap_net_bind_service+ep' ./tmp_with_setcap
./tmp_with_setcap

go build --race -o tmp_no_setcap
./tmp_no_setcap

What did you expect to see?

Neither of these two reaching the end.

What did you see instead?

The last one correctly terminates; the one with setcap doesn't and reaches the end.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Apr 4, 2023
@ianlancetaylor
Copy link
Member

CC @dvyukov

@ianlancetaylor ianlancetaylor added RaceDetector NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 4, 2023
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Apr 4, 2023
@dvyukov
Copy link
Member

dvyukov commented Apr 5, 2023

The issues is much wider. I've filed google/sanitizers#1640. Let's move the discussion there.

@mknyszek
Copy link
Contributor

mknyszek commented Apr 5, 2023

In triage now, we're thinking we'll close it for now as a duplicate of google/sanitizers#1640. Feel free to reopen if that's not the case. Thanks.

@mknyszek mknyszek closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
@golang golang locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. RaceDetector
Projects
None yet
Development

No branches or pull requests

5 participants