-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: infinite loop causing stack overflow in bufio #38481
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
Comments
Please show us a working sample that shows the problem. Thanks. |
The only thing I can think of that could lead to this is if you reset a Writer to Write to itself! https://play.golang.org/p/fyrX0v3glpM If you do that, I think you deserve recursion til stack exhaustion :-) |
Actually, this must have been what @Nemo-G did, as Flush() calls Write() only on the underlying Writer, and the first argument to both Flush() and Write() in the stack trace have the same pointer 0xc000078d40. So, the bufio.Writer has itself as underlying Writer. |
A I'm going to close this issue because it doesn't sound like there is a bug in Go here. Please comment if you disagree. If you want help with Go, please use a forum. See https://golang.org/wiki/Questions. Thanks. |
@ianlancetaylor Sure. Sorry for the trouble. Thanks for your help! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
simply call Write([]byte)
What did you expect to see?
We could panic instead.
What did you see instead?
Infinite loop causing stack overflow
The text was updated successfully, but these errors were encountered: