ToniAdreal opened a new pull request, #12437: URL: https://github.com/apache/arrow-rs/pull/12437
Follow-up to #12410, which fixed the construction-time leak for #12409. #12410 strips trailing bytes in `FixedSizeBinaryArray::try_new_with_len`, so the checked constructors no longer expose them. One path is still open: `FixedSizeBinaryArray::new_unchecked` stores the buffer as-is (unless `force_validate`), and `FixedSizeBinaryBuilder::append_array` copied `value_data()` wholesale — the issue itself calls out this exact spot. An unchecked array carrying trailing bytes could still pollute the builder and shift every element appended afterwards. Changes: - `FixedSizeBinaryBuilder::append_array` now copies only `len * value_size` bytes before extending. - One regression test, `test_fixed_size_binary_builder_append_array_unchecked_trailing_bytes`: appending an unchecked 10-byte array (value_size 3) asserts the builder holds 9 bytes and the finished array reports 9. (Named with an `unchecked` infix to avoid colliding with the `test_fixed_size_binary_builder_append_array_trailing_bytes` test added in #12410, which covers the checked path.) Verification: - Reproduction test failed before the fix (`values_slice().len()` was 10, expected 9) and passes after. - `cargo test -p arrow-array --lib fixed_size_binary`: 45 passed, 0 failed. - `cargo test -p arrow-array --lib`: 765 passed, 0 failed, 1 ignored, 1 filtered out. The filtered test is `test_gc_huge_array`, which the 6 GB dev cell OOM-kills (SIGKILL, unrelated to this change); CI should run it. - `cargo clippy -p arrow-array`: clean, no warnings. - `cargo fmt --all -- --check`: clean. AI assistance disclosure: This PR was prepared with AI assistance (Muse). I reviewed the diff line by line, I understand the change, and I ran the tests listed above. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
