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
bufio: altered value when reading from tcpstream #14055
Comments
I'm sorry, we cannot accept an issue report with zero error checking. On Fri, 22 Jan 2016, 00:04 Benjamin Chenebault notifications@github.com
|
Sorry, issue updated. |
@BenC- thanks for your issue report, i've confirmed this is a possible issue related to inlining or escape analysus. Running the sample program with However, at 33a784e the issue is gone. I suspect that this was fixed by @dr2chase 's recent escape analysis fixes. |
@BenC- if you are able, you can try building master from source to verify the fix. If you don't want to build form source, the next beta or rc candidate should be out in a week or so. |
@davecheney Maybe i'm wrong but the issue seems to persist an in at 33a784e. Failure cases below.
|
Program is invalid. It assumes that ReadLine returns a string (the "str" variables), but it's not a string. It's a slice of memory and you don't own it. See: https://golang.org/pkg/bufio/#Reader.ReadLine
|
Well, but this behavior implies a loss of backward compatibility since go1.5. But you'll reply I should not have trusted a pointer I don't own... ;) Sorry for the inconvenience. |
That we my mistake, sorry, I thought ReadLine returned a string not a On Fri, 22 Jan 2016, 04:25 Benjamin Chenebault notifications@github.com
|
I received altered data when reading from tcpstream.
Pointer receivedAAA is partially overwritten by pointer receivedBBB. (side effect of readSlice()?)
Only appears on unit testing.
Works fine with go1.4.2, go 1.4.3.
Here is a way to reproduce the issue:
Output
Error seems to be due to client bufio, since tcp dump is correct
The text was updated successfully, but these errors were encountered: