-
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
bytes: Buffer.ReadFrom is wrong #24091
Comments
Change https://golang.org/cl/96915 mentions this issue: |
Where's the repro code? Got a play.golang.org example? |
@bradfitz I'll add the repro code later, I can easily repro it in Kubernetes test. But I haven't got a simple repro version yet. If you take a look at the fix #24092, you'll see it's a pretty obvious bug...... introduced in 1ba4556#diff-91502c311c18a07cfd7df93b698604b0. |
We'll wait. We don't accept patches without repros or tests. |
@bradfitz OK. I'll probably add the repro code after the weekends. |
It turns out to be a behavior change under race condition from golang 1.9 to golang 1.10. With golang 1.9, we'll never get corrupted data:
But with golang 1.10, we'll usually get corrupted data:
However, I'll close this issue and #24092, and fix our issue instead. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.10
Does this issue reproduce with the latest release?
Yeah
What operating system and processor architecture are you using (
go env
)?Linux
What did you do?
After
io.Copy
into an emptybytes.Buffer
, the buffer is corrupted.What did you expect to see?
I expect to get this result after
io.Copy
, and I did get this with golang 1.9:What did you see instead?
But I get this result with golang 1.10 instead:
The text was updated successfully, but these errors were encountered: