Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexreg
Created July 22, 2019 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexreg/c7afa2a62fa5d44aa1718bba14f36322 to your computer and use it in GitHub Desktop.
Save alexreg/c7afa2a62fa5d44aa1718bba14f36322 to your computer and use it in GitHub Desktop.
$ RUST_BACKTRACE=1 ./miri run foo.rs
Finished release [optimized] target(s) in 0.06s
Finished release [optimized] target(s) in 0.05s
Running `target/release/miri --sysroot /Users/alex/Software/rust-devel/build/x86_64-apple-darwin/stage2 foo.rs`
error[E0080]: Miri evaluation error: attempted to do invalid arithmetic on pointers that would leak base addresses, e.g., comparing pointers into different allocations
--> /Users/alex/Software/rust-devel/src/libcore/intrinsics.rs:1340:19
|
1340 | let diff = if src_usize > dst_usize {
| ^^^^^^^^^^^^^^^^^^^^^ Miri evaluation error: attempted to do invalid arithmetic on pointers that would leak base addresses, e.g., comparing pointers into different allocations
|
= note: inside call to `std::intrinsics::overlaps::<u8>` at /Users/alex/Software/rust-devel/src/libcore/intrinsics.rs:1440:20
= note: inside call to `std::ptr::copy_nonoverlapping::<u8>` at /Users/alex/Software/rust-devel/src/libcore/slice/mod.rs:2113:13
= note: inside call to `core::slice::<impl [u8]>::copy_from_slice` at /Users/alex/Software/rust-devel/src/liballoc/vec.rs:2023:13
= note: inside call to `<std::vec::Vec<u8> as std::vec::SpecExtend<&u8, std::slice::Iter<u8>>>::spec_extend` at /Users/alex/Software/rust-devel/src/liballoc/vec.rs:1464:9
= note: inside call to `std::vec::Vec::<u8>::extend_from_slice` at /Users/alex/Software/rust-devel/src/liballoc/slice.rs:159:9
= note: inside call to `std::slice::hack::to_vec::<u8>` at /Users/alex/Software/rust-devel/src/liballoc/slice.rs:379:9
= note: inside call to `std::slice::<impl [u8]>::to_vec` at /Users/alex/Software/rust-devel/src/liballoc/slice.rs:654:9
= note: inside call to `std::slice::<impl std::borrow::ToOwned for [u8]>::to_owned` at /Users/alex/Software/rust-devel/src/liballoc/str.rs:202:46
= note: inside call to `std::str::<impl std::borrow::ToOwned for str>::to_owned` at /Users/alex/Software/rust-devel/src/libstd/rt.rs:40:39
= note: inside call to `std::rt::lang_start_internal` at /Users/alex/Software/rust-devel/src/libstd/rt.rs:64:5
= note: inside call to `std::rt::lang_start::<()>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.
!1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment