-
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
runtime/race: eliminate dependency on libc #9918
Comments
related to #6508 |
Hi, I wish to add that currently doing PROJECT_DIR="${PWD}" #assume we are in $GOPATH/src/github.com/dlsniper/demo on the computer
CONTAINER_PROJECT_DIR="/go/src/github.com/dlsniper/demo"
CONTAINER_PROJECT_GOPATH="${CONTAINER_PROJECT_DIR}/vendor:/go"
docker run --rm \
--net="host" \
-v ${PROJECT_DIR}:${CONTAINER_PROJECT_DIR} \
-e CI=true \
-e GODEBUG=netdns=go \
-e CGO_ENABLED=0 \
-e GOPATH=${CONTAINER_PROJECT_GOPATH} \
-w "${CONTAINER_PROJECT_DIR}" \
golang:1.5.3-alpine \
go test -v -race ./... Output:
Not sure if I should open a separate issue or this comment is enough, please advise. Also the example is not meant to work as it currently points to an non-existing repository but I can make it work if needed. Thank you. |
Please file a separate issue. Race detector must work regardless of dependency on libc. Looks like some issue with linker. Does it work with 1.6? I guess it won't be fixed in 1.5 at this point. |
CL https://golang.org/cl/41678 mentions this issue. |
…s on Alpine In an effort to at least understand the complete set of things not working on Alpine Linux, I've been trying to get the build passing again, even with tests disabled. The race detector is broken on Alpine. That is #14481 (and #9918). So disable those tests for now. Also, internal linking with PIE doesn't work on Alpine yet. That is #18243. So disable that test for now. With this CL, all.bash almost passes. There's some cgo test failing still, but there's no bug yet, so that can be a separate CL. Change-Id: I3ffbb0e787ed54cb82f298b6bd5bf3ccfbc82622 Reviewed-on: https://go-review.googlesource.com/41678 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Enable the Go race detector to help surface race conditions when running the tests. The race detector currently depends on libc, so does not work with Alpine Linux (which uses musl): golang/go#9918 golang/go#14481 Instead, use the default Go Docker image, which uses the libc-based Debian Jessie and update the Dockerfiles accordingly.
Enable the Go race detector to help surface race conditions when running the tests. The race detector currently depends on libc, so does not work with Alpine Linux (which uses musl): golang/go#9918 golang/go#14481 Instead, use the default Go Docker image, which uses the libc-based Debian Jessie and update the Dockerfiles accordingly.
This issue seems fairly out of date; these days attempting to use |
From https://tip.golang.org/doc/go1.20:
I can confirm |
On
|
Race runtime currently depends on libc:
with CGO_ENABLED=0:
runtime/race(.text): __libc_malloc: not defined
runtime/race(.text): getuid: not defined
runtime/race(.text): pthread_self: not defined
...
This has several negative effects:
If we eliminate all libc dependencies from race runtime, all these problems go away.
The text was updated successfully, but these errors were encountered: