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
= help: this program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`, which means that Miri might miss pointer bugs in this program
8
+
= help: see https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation
9
+
= help: to ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead
10
+
= help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics
11
+
= help: alternatively, `MIRIFLAGS=-Zmiri-permissive-provenance` disables this warning
12
+
= note: BACKTRACE:
13
+
= note: inside `unexposed_reachable_alloc` at tests/native-lib/fail/trace_read.rs:LL:CC
14
+
note: inside `main`
15
+
--> tests/native-lib/fail/trace_read.rs:LL:CC
16
+
|
17
+
LL | unexposed_reachable_alloc();
18
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
+
1
20
error: Undefined Behavior: pointer not dereferenceable: pointer must be dereferenceable for 4 bytes, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
2
21
--> tests/native-lib/fail/trace_read.rs:LL:CC
3
22
|
4
-
LL | println!("{}", *invalid);
5
-
| ^^^^^^^^ Undefined Behavior occurred here
23
+
LL | ... println!("{}", *invalid);
24
+
| ^^^^^^^^ Undefined Behavior occurred here
6
25
|
7
26
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
27
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
warning: sharing memory with a native function called via FFI
2
+
--> tests/native-lib/fail/trace_write.rs:LL:CC
3
+
|
4
+
LL | init_n(2, slice_ptr);
5
+
| ^^^^^^^^^^^^^^^^^^^^ sharing memory with a native function
6
+
|
7
+
= help: when memory is shared with a native function call, Miri can only track initialisation and provenance on a best-effort basis
8
+
= help: in particular, Miri assumes that the native call initializes all memory it has written to
9
+
= help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory
10
+
= help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free
11
+
= help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here
12
+
= note: BACKTRACE:
13
+
= note: inside `partial_init` at tests/native-lib/fail/trace_write.rs:LL:CC
14
+
note: inside `main`
15
+
--> tests/native-lib/fail/trace_write.rs:LL:CC
16
+
|
17
+
LL | partial_init();
18
+
| ^^^^^^^^^^^^^^
19
+
20
+
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
21
+
--> tests/native-lib/fail/trace_write.rs:LL:CC
22
+
|
23
+
LL | let _val = *slice_ptr.offset(2);
24
+
| ^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
25
+
|
26
+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
27
+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
28
+
= note: BACKTRACE:
29
+
= note: inside `partial_init` at tests/native-lib/fail/trace_write.rs:LL:CC
30
+
note: inside `main`
31
+
--> tests/native-lib/fail/trace_write.rs:LL:CC
32
+
|
33
+
LL | partial_init();
34
+
| ^^^^^^^^^^^^^^
35
+
36
+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
37
+
38
+
error: aborting due to 1 previous error; 1 warning emitted
| ^^^^^^^^^^^^^^^^^ sharing memory with a native function
6
+
|
7
+
= help: when memory is shared with a native function call, Miri can only track initialisation and provenance on a best-effort basis
8
+
= help: in particular, Miri assumes that the native call initializes all memory it has written to
9
+
= help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory
10
+
= help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free
11
+
= help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here
12
+
= note: BACKTRACE:
13
+
= note: inside `test_access_pointer` at tests/native-lib/pass/ptr_read_access.rs:LL:CC
| ^^^^^^^^^^^^^^^^^^^^^ sharing memory with a native function
6
+
|
7
+
= help: when memory is shared with a native function call, Miri can only track initialisation and provenance on a best-effort basis
8
+
= help: in particular, Miri assumes that the native call initializes all memory it has written to
9
+
= help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory
10
+
= help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free
11
+
= help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here
12
+
= note: BACKTRACE:
13
+
= note: inside `test_increment_int` at tests/native-lib/pass/ptr_write_access.rs:LL:CC
0 commit comments