You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Spikhalskiy (via GitHub)" <gi...@apache.org> on 2026/10/21 17:10:07 UTC
[PR] GH-54916: [C++][IPC] Align metadata in Message::Open [arrow]
Spikhalskiy opened a new pull request, #54917:
URL: https://github.com/apache/arrow/pull/54917
### Rationale for this change
`ipc::Message::Open()` verifies and reads the Flatbuffers metadata in place. Flight passes it a `data_header` sliced zero-copy out of the gRPC message, which can start at any address, so Flatbuffers performs misaligned loads (reported by `-fsanitize=alignment`). `MaybeAlignMetadata()` already exists for this, but only `MessageDecoder` calls it.
### What changes are included in this PR?
`MessageImpl::Open()` now calls `MaybeAlignMetadata()` before verifying the metadata. Aligned metadata, including everything that comes through `MessageDecoder`, is not copied.
### Are these changes tested?
Yes. `TestMessage.OpenUnalignedMetadata` opens a message whose metadata starts at an odd address and checks that it round-trips and that `Message::metadata()` is 8-byte aligned. Without the fix the alignment check fails, and under `-fsanitize=alignment` the test reports misaligned accesses in `VerifyMessage` and `GetKeyValueMetadata`. With the fix it passes cleanly.
### Are there any user-facing changes?
No. `Message::metadata()` may now return an aligned copy instead of the buffer passed to `Message::Open()`.
### Was AI used for this PR?
**PR code and description written by:**
- [ ] Human
- [x] AI
**Reviewed before submission by:**
- [x] Human
- [ ] AI
- [ ] Not reviewed
Closes #54916
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-54916: [C++][IPC] Align metadata in Message::Open [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #54917:
URL: https://github.com/apache/arrow/pull/54917#issuecomment-6321935520
:warning: GitHub issue #54916 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org