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
enable_experimental;
let ref_to_fresh n ty = do {
x <- mir_fresh_var n ty;
r <- mir_alloc ty;
mir_points_to r (mir_term x);
return (x, r);
};
let foo_spec = do {
(x, r_x) <- ref_to_fresh "x" (mir_array 4 mir_u8);
mir_execute_func [r_x];
};
m <- mir_load_module "test.linked-mir.json";
mir_verify m "test::foo" [] false foo_spec z3;
$ ~/Software/saw-1.1/bin/saw test.saw
[11:57:58.326] Loading file "/home/ryanscott/Documents/Hacking/SAW/test.saw"
[11:57:58.332] Verifying test/d9b5c637::foo[0] ...
[11:57:58.340] Simulating test/d9b5c637::foo[0] ...
[11:57:58.341] Stack trace:
"mir_verify" (/home/ryanscott/Documents/Hacking/SAW/test.saw:16:1-16:11)
Symbolic execution failed.
Abort due to assertion failure:
/home/ryanscott/.rustup/toolchains/nightly-2023-01-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:473:43: 473:48 !/home/ryanscott/.rustup/toolchains/nightly-2023-01-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:386:54: 386:69: error: in core/73237d41::slice[0]::index[0]::{impl#4}[0]::get_unchecked[0]::_instaddce72e1232152c[0]
Translation error in core/73237d41::slice[0]::index[0]::{impl#4}[0]::get_unchecked[0]::_instaddce72e1232152c[0]: callExp: Don't know how to call core/73237d41::intrinsics[0]::{extern#0}[0]::offset[0]::_instaddce72e1232152c[0]
I used SAW to reproduce this crash (it is surprisingly difficult to reproduce using crux-mir), but the issue really lies in crucible-mir. The problem is that the get_unchecked slice-indexing function (as well as its cousin, get_unchecked_mut) are too low-level for crucible-mir to handle at the moment.
In the previous Rust nightly that crucible-mir supported (2020-03-22), we put custom overrides in place to handle these functions—see 349feee for how these were handled. Unfortunately, these overrides weren't ported over when we upgraded to the 2023-01-23 nightly. I believe that porting these overrides to the more recent nightly would fix this issue. Note that nowadays, the get_unchecked{,_mut} functions now live in core::slice::index::{impl} rather than core::slice::{impl}.
The text was updated successfully, but these errors were encountered:
My assessement in #1180 (comment) is slightly off. crucible-mir no longer needs custom handles for get_unchecked{,_mut}, as crucible-mir now supports pointer offset operations via this code. However, this code only handles the high-level offset function, but not the offset intrinsic of the same name, which is what we are failing on in the example above. With that in mind, here is a minimal program that causes crux-mir to fail with the same error:
Given this Rust code:
The following spec will crash SAW 1.1:
I used SAW to reproduce this crash (it is surprisingly difficult to reproduce using
crux-mir
), but the issue really lies incrucible-mir
. The problem is that theget_unchecked
slice-indexing function (as well as its cousin,get_unchecked_mut
) are too low-level forcrucible-mir
to handle at the moment.In the previous Rust nightly that
crucible-mir
supported (2020-03-22
), we put custom overrides in place to handle these functions—see 349feee for how these were handled. Unfortunately, these overrides weren't ported over when we upgraded to the2023-01-23
nightly. I believe that porting these overrides to the more recent nightly would fix this issue. Note that nowadays, theget_unchecked{,_mut}
functions now live incore::slice::index::{impl}
rather thancore::slice::{impl}
.The text was updated successfully, but these errors were encountered: