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

Windows named pipes hits unreachable code during read operation #1660

Closed
agneil opened this issue Mar 13, 2023 · 3 comments
Closed

Windows named pipes hits unreachable code during read operation #1660

agneil opened this issue Mar 13, 2023 · 3 comments
Assignees
Milestone

Comments

@agneil
Copy link

agneil commented Mar 13, 2023

This is an issue we're having trouble reproducing, however, there have been instances of crashing on Windows due to the unreachable! line in the snippet of the read_done function below:

// Move from the `Pending` to `Ok` state.
let mut io = me.io.lock().unwrap();
let mut buf = match mem::replace(&mut io.read, State::None) {
State::Pending(buf, _) => buf,
_ => unreachable!(),

I don't see an apparent cause, but I'm curious as to whether it could be possible the snippet below inside scheduled_read is returning an error that causes mem::forget not to be run as anticipated so the state is Err rather than Pending?

let e = unsafe {
let overlapped = me.read.as_ptr() as *mut _;
let slice = slice::from_raw_parts_mut(buf.as_mut_ptr(), buf.capacity());
me.read_overlapped(slice, overlapped)
};

@Thomasdezeeuw
Copy link
Collaborator

@carllerche do you have time to look at this?

@Thomasdezeeuw Thomasdezeeuw added this to the v1.0 milestone Dec 8, 2023
@Thomasdezeeuw
Copy link
Collaborator

@agneil any chance that #1772 solve this problem? The reporter of that issue is hitting the same panic as you did here.

@Thomasdezeeuw
Copy link
Collaborator

Closing because we can't reproduce this.

@agneil if you can share code to reproduce this please do, if this an issue we still like to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants