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

fix: undefined behavior in schema ffi #582

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Conversation

roee88
Copy link
Contributor

@roee88 roee88 commented Jul 21, 2021

Closes #580

Rationale for this change

The undefined behavior that was fixed in #323 was re-introduced in #439.
This PR attempts to re-introduce the same fix.

Closes apache#580

Signed-off-by: roee88 <roee88@gmail.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 21, 2021
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW when I tested this change locally with MIRI it passed the tests that were previously failing

alamb@MacBook-Pro arrow-rs % git cherry-pick 7e5f4d1285baacfe56bbf4026cea6bb2da873bb1
git cherry-pick 7e5f4d1285baacfe56bbf4026cea6bb2da873bb1
Auto-merging arrow/src/ffi.rs
[alamb/validate_output_of_miri 1d075e2e2] fix: undefined behavior in schema ffi
 Author: roee88 <roee88@gmail.com>
 Date: Wed Jul 21 15:33:51 2021 +0300
 1 file changed, 6 insertions(+), 3 deletions(-)
alamb@MacBook-Pro arrow-rs % MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test -p arrow -- --ignored ffi
MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test -p arrow -- --ignored ffi
WARNING: Ignoring `RUSTC_WRAPPER` environment variable, Miri does not support wrapping.
   Compiling arrow v6.0.0-SNAPSHOT (/Users/alamb/Software/arrow-rs/arrow)
    Finished test [unoptimized + debuginfo] target(s) in 3.04s
     Running unittests (target/miri/x86_64-apple-darwin/debug/deps/arrow-111eb02f3e835a62)

running 6 tests
test array::ffi::tests::test_struct ... ok
test datatypes::ffi::tests::test_field ... ok
test datatypes::ffi::tests::test_schema ... ok
test datatypes::ffi::tests::test_type ... ok
test ffi::tests::test_large_list ... ok
test ffi::tests::test_list ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 760 filtered out

   Doc-tests arrow

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 103 filtered out; finished in 0.01s

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it passes MIRI looks good to me 👍

@codecov-commenter
Copy link

Codecov Report

Merging #582 (7e5f4d1) into master (e3d4c6a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #582      +/-   ##
==========================================
- Coverage   82.46%   82.45%   -0.01%     
==========================================
  Files         167      167              
  Lines       46205    46205              
==========================================
- Hits        38101    38100       -1     
- Misses       8104     8105       +1     
Impacted Files Coverage Δ
arrow/src/ffi.rs 87.07% <100.00%> (ø)
parquet/src/encodings/encoding.rs 94.85% <0.00%> (-0.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3d4c6a...7e5f4d1. Read the comment docs.

@alamb
Copy link
Contributor

alamb commented Jul 21, 2021

https://github.com/apache/arrow-rs/pull/582/checks?check_run_id=3123911024

Shows:

test result: ok. 89 passed; 0 failed; 0 ignored; 0 measured; 14 filtered out; finished in 12.50s

👍

@alamb
Copy link
Contributor

alamb commented Jul 21, 2021

Thank you so much @roee88

@alamb alamb merged commit d8da826 into apache:master Jul 21, 2021
@roee88 roee88 deleted the ffi-fix-580 branch July 21, 2021 13:22
alamb pushed a commit that referenced this pull request Jul 21, 2021
Closes #580

Signed-off-by: roee88 <roee88@gmail.com>
alamb added a commit that referenced this pull request Jul 25, 2021
Closes #580

Signed-off-by: roee88 <roee88@gmail.com>

Co-authored-by: Roee Shlomo <roee88@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MIRI failure in array::ffi::tests::test_struct and other ffi tests
3 participants