You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pedrobtz (via GitHub)" <gi...@apache.org> on 2026/10/21 22:00:31 UTC
[PR] fix(ipc): Reject fields that share a dictionary with different value types [arrow-nanoarrow]
pedrobtz opened a new pull request, #989:
URL: https://github.com/apache/arrow-nanoarrow/pull/989
`ArrowIpcDictionariesInit()` supports several fields sharing one dictionary id. It makes one `ArrowIpcDictionary` per unique id and decodes its batches with the value type of the first field that has that id. Nothing checks that the other fields with the id have the same value type. If they don't, `ArrowIpcDecoderWalkSetArrayView()` views the decoded dictionary with the second field's type.
For a `string` dictionary read by a field whose values are `large_string`, the 4-byte offsets are read as 8-byte ones. ASan reports a heap-buffer-overflow in `ArrowArrayViewValidateDefault()`. `ArrowIpcArrayStreamReader` hits this on a schema message with two such fields, followed by a dictionary batch and a record batch.
`ArrowIpcDictionariesInit()` now returns `EINVAL` when two fields share an id but not a value type. The comparison covers formats, children and nested dictionaries, not names, flags or metadata. Shared dictionaries with the same value type work as before.
The new `NanoarrowIpcSharedDictionaryValueTypes` test initialises dictionaries for two fields with id 0, first both `string`, then `string` and `large_string`. It expects success and then `EINVAL`. Without the fix the second case succeeds. I also read the stream that crashed through `ArrowIpcArrayStreamReader`. It now fails with the new message instead of reading out of bounds.
Found by fuzzing the IPC reader in the [zuarrow](https://github.com/pedrobtz/zuarrow) R package, which vendors nanoarrow.
`ctest` passes 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](https://claude.com/claude-code)
--
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] fix(ipc): Reject fields that share a dictionary with different value types [arrow-nanoarrow]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #989:
URL: https://github.com/apache/arrow-nanoarrow/pull/989#issuecomment-6407777751
## [Codecov](https://app.codecov.io/gh/apache/arrow-nanoarrow/pull/989?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `78.94737%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 78.64%. Comparing base ([`55df060`](https://app.codecov.io/gh/apache/arrow-nanoarrow/commit/55df06001d6c13294642fa3b741ac4e316553b3e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`af99348`](https://app.codecov.io/gh/apache/arrow-nanoarrow/commit/af99348b644f9faae2ed33e2b7b56d270bdd2ede?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on main.
| [Files with missing lines](https://app.codecov.io/gh/apache/arrow-nanoarrow/pull/989?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [src/nanoarrow/ipc/decoder.c](https://app.codecov.io/gh/apache/arrow-nanoarrow/pull/989?src=pr&el=tree&filepath=src%2Fnanoarrow%2Fipc%2Fdecoder.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL25hbm9hcnJvdy9pcGMvZGVjb2Rlci5j) | 78.94% | [1 Missing and 3 partials :warning: ](https://app.codecov.io/gh/apache/arrow-nanoarrow/pull/989?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #989 +/- ##
==========================================
+ Coverage 78.59% 78.64% +0.04%
==========================================
Files 106 106
Lines 17153 17172 +19
Branches 2043 2049 +6
==========================================
+ Hits 13482 13505 +23
+ Misses 2422 2417 -5
- Partials 1249 1250 +1
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/arrow-nanoarrow/pull/989?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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