-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Regression: File::open
not falling back to FileEndOfFileInfo
on WINE
#135831
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
File::open
not falling back to FileEndOfFileInfo
on WINE
Oh apologies it seems I left in some test code somehow. That panic message was definitely not meant to make it in to production. |
No worries, thanks for responding so quickly :) |
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 22, 2025
Remove test panic from File::open Fixes rust-lang#135831
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 22, 2025
Remove test panic from File::open Fixes rust-lang#135831
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jan 22, 2025
Remove test panic from File::open Fixes rust-lang#135831
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jan 22, 2025
Remove test panic from File::open Fixes rust-lang#135831
github-actions bot
pushed a commit
to tautschnig/verify-rust-std
that referenced
this issue
Mar 11, 2025
Remove test panic from File::open Fixes rust-lang#135831
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
As of what appears to be this commit ca56dc8, nightly crashes on WINE when running
File::open
.The issue appears to be that SetFileInformationByHandle returns
0
when it fails, and expects you to runGetLastError
to get the error code.In the code for
File::open
, there is a comment block explaining that this should fall back to usingFileEndOfFileInfo
if it fails, for WINE support.rust/library/std/src/sys/pal/windows/fs.rs
Lines 319 to 322 in cd805f0
However from this commit, the code will panic if the result of
api::get_last_error().code != 0
, meaning it will always panic ifFileAllocationInfo
fails, and will never attempt to useFileEndOfFileInfo
.Relevant source code:
rust/library/std/src/sys/pal/windows/fs.rs
Lines 331 to 340 in cd805f0
I tried this code:
I expected to see this happen:
Hello world
should be written totesting.txt
Instead, this happened: Rust panics with a backtrace.
Meta
rustc --version --verbose
:This does not occur on stable. Reverting to
nightly-2024-12-23
also works fine.Backtrace
The text was updated successfully, but these errors were encountered: