You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This first tries `FileAllocationInfo` but falls back to
// `FileEndOfFileInfo` in order to support WINE.
// If WINE gains support for FileAllocationInfo, we should
// remove the fallback.
However from this commit, the code will panic if the result of api::get_last_error().code != 0, meaning it will always panic if FileAllocationInfo fails, and will never attempt to use FileEndOfFileInfo.
This does not occur on stable. Reverting to nightly-2024-12-23 also works fine.
Backtrace
cargo xwin run --target x86_64-pc-windows-msvc
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
Running `wine target/x86_64-pc-windows-msvc/debug/rusttest.exe`
wineserver: using server-side synchronization.
wine: Using setpriority to control niceness in the [-10,10] range
thread 'main' panicked at library\std\src\sys\pal\windows\fs.rs:332:29:
FILE_ALLOCATION_INFO failed!!!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
MeguminSama
changed the title
Regression - File::open not falling back to FileEndOfFileInfo on WINE
Regression: File::open not falling back to FileEndOfFileInfo on WINE
Jan 21, 2025
saethlin
added
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jan 21, 2025
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 22, 2025
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: