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

Run tests with MIRI #5

Closed
lwwmanning opened this issue Feb 26, 2024 · 3 comments · Fixed by #517
Closed

Run tests with MIRI #5

lwwmanning opened this issue Feb 26, 2024 · 3 comments · Fixed by #517
Labels
good first issue Good for newcomers

Comments

@lwwmanning
Copy link
Member

lwwmanning commented Feb 26, 2024

something like RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check" cargo +nightly miri test

@lwwmanning lwwmanning transferred this issue from another repository Feb 27, 2024
@lwwmanning lwwmanning changed the title Run tests with MIRI for crates that don't use FFI Run tests with MIRI Jul 22, 2024
@lwwmanning lwwmanning added the good first issue Good for newcomers label Jul 22, 2024
@lwwmanning
Copy link
Member Author

MIRI currently fails:

test array::varbinview::test::flatten_array ... error: Undefined Behavior: incorrect layout on deallocation: alloc2920226 has size 32 and alignment 8, but gave size 32 and alignment 1
   --> /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/alloc.rs:119:14
    |
119 |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc2920226 has size 32 and alignment 8, but gave size 32 and alignment 1
    |
    = 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 on thread `array::varbinview::test::flatten_array`:
    = note: inside `std::alloc::dealloc` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/alloc.rs:119:14: 119:64
    = note: inside `<arrow_buffer::bytes::Bytes as std::ops::Drop>::drop` at /Users/will/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-buffer-52.1.0/src/bytes.rs:116:31: 116:78
    = note: inside `std::ptr::drop_in_place::<arrow_buffer::bytes::Bytes> - shim(Some(arrow_buffer::bytes::Bytes))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::sync::Arc::<arrow_buffer::bytes::Bytes>::drop_slow` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:1837:18: 1837:67
    = note: inside `<std::sync::Arc<arrow_buffer::bytes::Bytes> as std::ops::Drop>::drop` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:2524:13: 2524:29
    = note: inside `std::ptr::drop_in_place::<std::sync::Arc<arrow_buffer::bytes::Bytes>> - shim(Some(std::sync::Arc<arrow_buffer::bytes::Bytes>))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<arrow_buffer::Buffer> - shim(Some(arrow_buffer::Buffer))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<vortex_buffer::Buffer> - shim(Some(vortex_buffer::Buffer))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<std::option::Option<vortex_buffer::Buffer>> - shim(Some(std::option::Option<vortex_buffer::Buffer>))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<data::ArrayData> - shim(Some(data::ArrayData))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<Array> - shim(Some(Array))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<[Array]> - shim(Some([Array]))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::sync::Arc::<[Array]>::drop_slow` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:1837:18: 1837:67
    = note: inside `<std::sync::Arc<[Array]> as std::ops::Drop>::drop` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:2524:13: 2524:29
    = note: inside `std::ptr::drop_in_place::<std::sync::Arc<[Array]>> - shim(Some(std::sync::Arc<[Array]>))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<data::ArrayData> - shim(Some(data::ArrayData))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<Array> - shim(Some(Array))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<typed::TypedArray<array::varbinview::VarBinView>> - shim(Some(typed::TypedArray<array::varbinview::VarBinView>))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
    = note: inside `std::ptr::drop_in_place::<array::varbinview::VarBinViewArray> - shim(Some(array::varbinview::VarBinViewArray))` at /Users/will/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:542:1: 542:56
note: inside `array::varbinview::as_arrow`
   --> vortex-array/src/array/varbinview/mod.rs:291:1
    |
291 | }

@robert3005
Copy link
Member

This is a real bug fwiw where we change the alignment between allocation and freeing. The solution is to either have our own buffer type with alignment #454 or support a 16 byte wide primitives so alignment doesn’t change

@robert3005
Copy link
Member

At one point I was investigating it and added some miri ignores to get more things to run #514

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

Successfully merging a pull request may close this issue.

2 participants