Repository navigation
Conversation
Each Block was built on the stack with an initializer and copied into the footer, so its four bytes of padding after metaDataLength were whatever was on the stack. Zero the vector and set each field instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pedrobtz
force-pushed
the
fix-ipc-footer-block-padding
branch
from
October 22, 2026 15:27
90d613a to
0934365
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ArrowIpcEncoderEncodeFooter()builds eachBlockof the footer on the stack with an initializer, then copies it into the flatbuffer vector.Blockhas four bytes of padding aftermetaDataLength, and an initializer doesn't set padding. So the footer carried whatever bytes were on the stack. That makes files non-reproducible, and the stack bytes end up in the file. With Apple clang 17 at-O0, filling the stack with0xABbefore the call gives paddingabababab.The vector is now zeroed after
extend, and each element is set with the generatedBlock_assign(). Both the record batch and the dictionary block loops are changed.The new
NanoarrowIpcFooterEncodingIsDeterministictest encodes the same footer twice, after filling the stack with0x00and then0xFF, and requires identical bytes. In a plain Debug build it fails without the fix and passes with it. Under ASan it passes either way, because ASan moves stack frames.Found through a byte-for-byte determinism test in the zuarrow R package, which vendors nanoarrow.
ctestpasses in a plain Debug build and with ASan and UBSan (410 tests each). The changed files are formatted with the pinned clang-format 16.0.6.🤖 Generated with Claude Code