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
io: endless loop in MultiReader in Go 1.7 #16795
Comments
CL https://golang.org/cl/27397 mentions this issue. |
The CL says that this bug has been present since Go 1.0, so this is not a 1.7.1 issue. |
@ianlancetaylor, I think this is bad enough and in a core piece of io to warrant a fix, regardless of how many cycles it's been broken. Like I said, this bit me in real code and I had to go on a debugging spree to figure out what was going on. What would people who weren't comfortable debugging the standard library do? |
Hmmm, well, OK, I guess. |
Updates #16795 Change-Id: I0bcc34bb5a92a2c480aebfb0eb6ba57bcc7f7cfd Reviewed-on: https://go-review.googlesource.com/27551 Reviewed-by: Ian Lance Taylor <iant@golang.org>
If an io.Reader returned (non-zero, EOF), MultiReader would yield bytes forever. This bug has existed before Go 1 (!!), introduced in the original MultiReader implementation in https://golang.org/cl/1764043 and also survived basically the only update to this code since then (https://golang.org/cl/17873, git rev ccdca83), which was added in Go 1.7. This just bit me when writing a test for some unrelated code. Fixes #16795 Change-Id: I36e6a701269793935d19a47ac12f67b07179fbff Reviewed-on: https://go-review.googlesource.com/27397 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-on: https://go-review.googlesource.com/28633 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
https://golang.org/cl/17873 (git rev ccdca83, bug #13558) was added in Go 1.7 and introduced a bug where the EOF of a (non-zero, EOF) Read could be ignored and the MultiReader could loop, forever yielding bytes.
Just hit this myself.
The text was updated successfully, but these errors were encountered: