It seems to disable access to the memory mappings in the target process, so every time it accesses memory miri monitors it causes a trap, which the ptracing process catches and then handles (parsing the instruction currently being run for the parameters, unprotecting the relevant bit of memory, stepping the target process for one instruction and then reprotecting)
ekuber | a day ago
The FFI support is such a big deal and it is presented almost like an afterthought! I didn't even know people were working on it.
steveklabnik | a day ago
Truly great news!
itamarst | a day ago
"some truly cursed magic to let Miri trace quite precisely which memory the native code accesses" how do this work I want to know.
Looks like https://github.com/rust-lang/miri/pull/4326 which uses ptrace, but I still need to figure out how that helps.
sknebel | a day ago
It seems to disable access to the memory mappings in the target process, so every time it accesses memory miri monitors it causes a trap, which the ptracing process catches and then handles (parsing the instruction currently being run for the parameters, unprotecting the relevant bit of memory, stepping the target process for one instruction and then reprotecting)
https://github.com/rust-lang/miri/pull/4326/commits/a6b031d1f2832ee5c416d1f5c46b938cfa10c35e#diff-b8502767e262e08d7e36f562c0daeb30e694e05a5e99fd6e785cc5fae9907e5aR412
xnacly | a day ago
This thing feels so useful to me, finally no more unaligned writes because i fucked my growable bump allocator mmap usage up.