named_pipe icon indicating copy to clipboard operation
named_pipe copied to clipboard

Using a zero read timeout will incorrectly consume from pipe and write to buffer

Open swernli opened this issue 6 years ago • 0 comments

After the fix for #8 the IO will not get cancelled if using a zero timeout, consuming data from the pipe and trying to write it to a buffer that may no longer be in use. I added a test case that shows this over at https://github.com/swernli/named_pipe/commit/b1612125e241687510a94221cddd10e524fd0515

Partial output of test case:

running 1 test
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `[48, 49, 50, 51, 52, 53, 54, 55, 56, 57]`,
 right: `[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`', src\lib.rs:1609:9
note: Some details are omitted, run with `RUST_BACKTRACE=full

swernli avatar Jul 24 '19 23:07 swernli