blob: 1c0ad2f0dc9160da972f1b69b50340e1d456b2f6 [file] [log] [blame]
warning: sharing memory with a native function called via FFI
--> tests/native-lib/fail/tracing/partial_init.rs:LL:CC
|
LL | init_n(2, slice_ptr);
| ^^^^^^^^^^^^^^^^^^^^ sharing memory with a native function
|
= help: when memory is shared with a native function call, Miri can only track initialisation and provenance on a best-effort basis
= help: in particular, Miri assumes that the native call initializes all memory it has written to
= help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory
= 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
= help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here
= note: BACKTRACE:
= note: inside `partial_init` at tests/native-lib/fail/tracing/partial_init.rs:LL:CC
note: inside `main`
--> tests/native-lib/fail/tracing/partial_init.rs:LL:CC
|
LL | partial_init();
| ^^^^^^^^^^^^^^
error: Undefined Behavior: reading memory at ALLOC[0x2..0x3], but memory is uninitialized at [0x2..0x3], and this operation requires initialized memory
--> tests/native-lib/fail/tracing/partial_init.rs:LL:CC
|
LL | let _val = *slice_ptr.offset(2);
| ^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `partial_init` at tests/native-lib/fail/tracing/partial_init.rs:LL:CC
note: inside `main`
--> tests/native-lib/fail/tracing/partial_init.rs:LL:CC
|
LL | partial_init();
| ^^^^^^^^^^^^^^
Uninitialized memory occurred at ALLOC[0x2..0x3], in this allocation:
ALLOC (stack variable, size: 3, align: 1) {
00[wildcard] (ptr fragment 0)╼ 00[wildcard] (ptr fragment 0)╼ __ ━━░
}
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to 1 previous error; 1 warning emitted