Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

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

Open
swernli opened this issue Jul 24, 2019 · 0 comments

Comments

@swernli
Copy link

swernli commented Jul 24, 2019

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant