Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miri is detecting undefined behavior #14

Open
joseluis opened this issue Sep 15, 2024 · 2 comments
Open

miri is detecting undefined behavior #14

joseluis opened this issue Sep 15, 2024 · 2 comments

Comments

@joseluis
Copy link
Contributor

Latest version of miri is not happy with that line in the make_fat_ptr function.

cargo +nightly miri test

test retain ... error: Undefined Behavior: constructing invalid value: encountered 0x2598e0[noalloc], but expected a vtable pointer
   --> stack_dst-rs/src/lib.rs:314:14
    |
314 |     let rv = rv.ptr;
    |              ^^^^^^ constructing invalid value: encountered 0x2598e0[noalloc], but expected a vtable pointer
    |
    
   --> stack_dst-rs/src/fifo.rs:224:23
    |
224 |                 &mut *super::make_fat_ptr(data.as_mut_ptr() as *mut (), meta)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `retain`
   --> tests/fifo.rs:71:5
    |
71  |     stack.retain(|v| v.as_ref().0 > 2);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside closure
   --> tests/fifo.rs:47:12
@joseluis
Copy link
Contributor Author

joseluis commented Oct 7, 2024

This may be related to miri dropping support for simulating vtables, as explained here:

https://github.com/uazu/stakker/blob/5821c30409c19ca9167808b669c928c94bc5f177/src/queue/flat.rs#L14-L17

@thepowersgang
Copy link
Owner

Well, that'd explain it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants