Skip to content
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

Unreachable match arm in FillBuf is reachable #2727

Closed
jessa0 opened this issue Mar 22, 2023 · 1 comment
Closed

Unreachable match arm in FillBuf is reachable #2727

jessa0 opened this issue Mar 22, 2023 · 1 comment
Labels
A-io Area: futures::io bug

Comments

@jessa0
Copy link

jessa0 commented Mar 22, 2023

I hit this unreachable!() inside FillBuf with an AsyncRead implementation (wrapped in a BufReader) which calls a Javascript callback thru neon (which is an async operation) for the actual read, which means every "new" poll_read (i.e. either the first call ever or the first call after a Ready is returned) will return Pending at least once, including after EOF is hit, which is what triggers this bug. Of course, the AsyncRead implementation could track when EOF is hit and return Ready(0) forever after that, which is indeed what I used as a workaround, but I can't find anything in the AsyncRead documentation which actually requires implementors to do this.

See #2722 for a possible bug fix.

@taiki-e taiki-e added bug A-io Area: futures::io labels Mar 30, 2023
@jessa0
Copy link
Author

jessa0 commented Nov 23, 2023

Fixed by #2801

@jessa0 jessa0 closed this as completed Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: futures::io bug
Projects
None yet
Development

No branches or pull requests

2 participants