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

tokio::fs::File::from_std() assumes current file position is zero #6374

Open
allada opened this issue Mar 3, 2024 · 0 comments · May be fixed by #6381
Open

tokio::fs::File::from_std() assumes current file position is zero #6374

allada opened this issue Mar 3, 2024 · 0 comments · May be fixed by #6381
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-fs Module: tokio/fs

Comments

@allada
Copy link

allada commented Mar 3, 2024

Version
1.36.0

Platform
Any

Description
tokio::fs::File::from_std() assumes the file being passed in's position is zero even if the StdFile has a different seek position.

This can cause AsyncSeek<File>::poll_complete() to return the wrong file position which causes wrong behavior when using .seek().

See:
https://docs.rs/tokio/latest/src/tokio/fs/file.rs.html#242

@allada allada added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Mar 3, 2024
@Darksonn Darksonn added the M-fs Module: tokio/fs label Mar 4, 2024
@MarcusSorealheis MarcusSorealheis linked a pull request Mar 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-fs Module: tokio/fs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants