-
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 cmd/cgo #6508
Comments
This issue was updated by revision a1695d2. Update issue #6688 R=iant, rsc, bradfitz CC=golang-codereviews https://golang.org/cl/55100044 |
Gentle ping @dvyukov @ianlancetaylor how are we doing here? Is this issue still a concern? Could I be of help here with your guidance? |
This is still an issue. Fixing it will require wiping all dependencies on libc from race runtime. I've removed the main one -- on malloc/free -- some time ago, but there are still some minor ones. |
In the meantime, many people actively complained about that issue :) Many (including me!) seem to want to build scratch-based Docker images with race-detector-enabled binaries copied from the previous Docker build stage. What are minor things that are left? |
What are errors when cgo is disabled for -race build? |
go/src/cmd/go/internal/work/init.go Line 169 in 3fb1d95
If that check is commented out, it fails with:
which looks similar to #9918 (comment) |
To fix most of these one would need to add more ifdef's similar to this one: I would assume most uses of these libc functions can be simply removed as not needed for the Go version (e.g. isatty/pthread_self). Some may need to replaced with calls to internal analogs. E.g. for exit we have Die in sanitizer runtimes. Not sure why we ever need to call exit. Few may be harder to remove. These need to be dealt on a case-by-case basis. Once all of these are removed, we also need a test in llvm upstream to prevent introduction of new libc calls in future. |
The text was updated successfully, but these errors were encountered: