Trying to SeekFrom::Start past i64::MAX ICEs Miri #3680
Labels
A-shims
Area: This affects the external function shims
C-bug
Category: This is a bug.
E-good-first-issue
A good way to start contributing, mentoring is available
I-ICE
Impact: makes Miri crash with some ICE
This program (reduced from an ICE encountered when running the tests for https://crates.io/crates/tempfile):
will ICE with:
The problem is the standard library casts our
u64
SeekFrom
to ani64
(off64_t
isi64
):https://github.com/rust-lang/rust/blob/55cac26a9ef17da1c9c77c0816e88e178b7cc5dd/library/std/src/sys/pal/unix/fs.rs#L1296-L1302
But we just convert the
i64
to ani128
(withinto
):miri/src/shims/unix/foreign_items.rs
Lines 159 to 161 in 60a7200
Then we try to convert the
i128
numerically into au64
:miri/src/shims/unix/fs.rs
Lines 392 to 398 in 60a7200
... even though the standard library expects us to just return an error for a negative seek offset. We should do that.
The text was updated successfully, but these errors were encountered: