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
leaks memory on Go >= 1.19
#63276
Comments
-race
leaks memory on Go >= 1.19-race
leaks memory on Go >= 1.19
-race
leaks memory on Go >= 1.19-race
leaks memory on Go >= 1.19
@golang/compiler @golang/runtime |
Thanks for the report. @walles you write that this happens "On Linux (not on macOS)..." -- does that mean you've tried it on a mac and the leak doesn't happen, or just that the program is linux-specific? |
It leaks on macOS as well, sorry about that. I updated the repro case at the start of this ticket to use |
In triage, we're a bit unsure as to what the cause could be. It seems like bisecting the toolchain might be the best path forward to try and identify the root cause. |
@walles Would you be willing to do the bisection, since you have a reproducer readily available in your environment? |
@mknyszek What happened when you tried the repro? Did |
@walles , we might not get a chance to bisect this for a while. If you have a chance to bisect it, that might help us a lot with moving this issue forward more quickly. |
Do you think you could at least validate the repro case now? I have only run it myself, so if at least one other person could verify that it shows a leak that would be super! |
Can confirm I am seeing a leak with the same script on macOS
Output
|
git bisect points to https://go-review.googlesource.com/c/go/+/333529 |
Thank you @cuonglm for the bisect. Suspect CL seems plausible to me. I will dig into it a bit more. |
I didn't add go version go1.21.0 linux/amd64 cat /etc/*release: uname -a : What did you do?go build main.go What did you see instead?After 2 hours : |
What version of Go are you using (
go version
)?Inside of
docker run -it --rm golang:1.21
.Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
main.go
.go run -race main.go
(without-race
there is no leak)Also, just having the HTTP server part is enough to leak, but I wanted a repro that is standalone so the client code and the memory reporting code are there for that.
What did you expect to see?
Stable memory usage
What did you see instead?
Notes
The text was updated successfully, but these errors were encountered: