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
internal/poll: sending a zero-byte-payload UDP packet on Windows is a no-op #26668
Comments
Please, do. It would be nice, if you send change to fix TestUDPZeroBytePayload first - it is OK to break the test on Windows - just skip test on Windows. And then send change to fix windows internal/poll.FD.WriteTo - together with making TestUDPZeroBytePayload run again. I am not sure how close we are to releasing go1.11, so your changes might have to wait for couple of weeks. But I suggest you send the change now - and see what happens. Thank you. Alex |
If nobody wants to claim this, I'm able to make time for this tomorrow. I predominantly develop on Windows, so the friction of testing this sort of bug is low. @delthas Are you currently working on this? |
I'm not, feel free to claim the issue :)
…On 2018 9 1 07:46:02 UTC, Jake Bentvelzen ***@***.***> wrote:
If nobody wants to claim this, I'm able to make time for this tomorrow.
I predominantly develop on Windows, so the friction of testing this
sort of bug is low.
@delthas Are you currently working on this?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#26668 (comment)
|
Change https://golang.org/cl/132780 mentions this issue: |
Change https://golang.org/cl/132781 mentions this issue: |
@silbinarywolf thank you for working on this! Since Go1.11 was released a month after @alexbrainman's suggestion in #26668 (comment), I don't think we need to disable the test anymore and you can instead send the single CL as you've done in https://golang.org/cl/132781. |
@odeke-em Fair enough. I wasn't sure how to close the CL so I added a comment / edited it saying to ignore it in favour of the single CL. Cheers! |
What version of Go are you using (
go version
)?go version go1.10.3 windows/amd64
Does this issue reproduce with the latest release?
Yes,
1.10.3
is the latest release.What operating system and processor architecture are you using (
go env
)?(Irrelevant)
What did you do?
Minimal working example: https://play.golang.org/p/aFzB44u87fO
This playground example only works on Linux (so it works in the playground). Run it on a Windows machine to see the bug.
On Windows, send a zero-length-payload UDP packet and try to read it.
What did you expect to see?
I would expect to see the same behaviour as on Linux, which is that the packet is received.
What did you see instead?
The packet is not received and the read timeouts.
This bug is due to a payload length check in internal/poll/fd_windows.go that returns early before any WSAsendto call is done.
This check was added in the first implementation of this method in this commit in 2010.
There is a test supposed to cover this specific case: TestUDPZeroBytePayload in net/udpsock_test.go but it is "broken" on Windows: the test sends a zero-byte-payload and reads it with
ReadFrom
, and then sends another packet and reads it withRead
. A comment reads that for the former case theReadFrom
should return witherr == nil
, and in the latter case theRead
should return with a timeout error, however it does not actually check if this is the case and accepts timeouts for both cases. And on Windows, the two cases return with a timeout error, rather than the expected behaviour, because no actual packet is sent because of the check linked above.A simple fix for this is to remove the check, and update the test to actually check if there is no timeout error in the
ReadFrom
case.Can I open a pull request to fix this?
The text was updated successfully, but these errors were encountered: