You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Darwin 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Subcrates
io_util
Description
I've started using tokio recently for simple TCP floodsub server and noticed panics triggered by debug_assertion in read_line_internal, after some research I found out the quite strange conditions of the panic to occur:
Clients should connect quite often.
Clients should send the payload that has something after \n.
Clients should not read anything from server (while server sends them something).
One place that can return Poll::Ready is this line
return Poll::Ready(Ok(mem::replace(read, 0)));
which leaves a zero in read, which means it should not trigger the assert.
The other possibility is the question mark on this line returning an error through this Try impl. This appears plausible. I guess it should handle failures halfway through better.
Darksonn
added a commit
to Darksonn/tokio
that referenced
this issue
May 16, 2020
Version
└── tokio v0.2.20
Platforms
Darwin 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Subcrates
io_util
Description
I've started using tokio recently for simple TCP floodsub server and noticed panics triggered by debug_assertion in
read_line_internal
, after some research I found out the quite strange conditions of the panic to occur:\n
.Here is the project that recreates the panic condition: https://github.com/artemii235/bufreader-debug-assert, the
RUST_BACKTRACE=full cargo run
should recreate the panic and print the following at least on platforms mentioned above:The text was updated successfully, but these errors were encountered: