microsoft / microsoft/demikernel

[catnap] ambiguous use of Fail::errno for Windows

Open
#970 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
1.2k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Description

The catnap runtime for Windows uses socket2 for underlying I/O. This crate indicates errors with the std::io::Error type, which relies upon the Rust-specific ErrorKind enum. Several sites in the code (such as catnap/socket.rs method try_pop) coerce the ErrorKind value into the error constructor. It seems the desired behavior is to use Fail's From<io::Error> trait.

How to Reproduce

Cause any failure condition on a Windows/catnap setup. The returned Err(e), e.errno will be an ErrorKind value.

Expected Behavior

Ideally we would translate the I/O error kind into a valid errno; however, even using the EIO code with the correct cause would improve correctness.

Related Issues

Possibly #344

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/rust/catnap/socket.rs at the try_pop method and inspect the other sites that coerce ErrorKind into the error constructor. Reproduce a failure on a Windows/catnap setup and trace the returned Err(e). Done means the I/O error is translated into a valid errno, or uses EIO with the original cause as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.