fix(ipc): Reject fields that share a dictionary with different value types #989
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.51) × (1 − Review Confidence (0.65)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.51 · 98 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.58 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.275
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
2 items
Codecov Report
:x: Patch coverage is
78.94737% with 4 lines in your changes missing coverage. Please review.:white_check_mark: Project coverage is 78.56%. Comparing base (
08d23f6) to head (4e3bc4c).| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/nanoarrow/ipc/decoder.c | 78.94% | 1 Missing and 3 partials :warning: |
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #989 +/- ##
==========================================
+ Coverage 78.52% 78.56% +0.04%
==========================================
Files 106 106
Lines 17195 17214 +19
Branches 2064 2070 +6
==========================================
+ Hits 13502 13525 +23
+ Misses 2431 2426 -5
- Partials 1262 1263 +1
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
pedrobtz
ArrowIpcDictionariesInit()supports several fields sharing one dictionary id. It makes oneArrowIpcDictionaryper 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
stringdictionary read by a field whose values arelarge_string, the 4-byte offsets are read as 8-byte ones. ASan reports a heap-buffer-overflow inArrowArrayViewValidateDefault().ArrowIpcArrayStreamReaderhits this on a schema message with two such fields, followed by a dictionary batch and a record batch.ArrowIpcDictionariesInit()now returnsEINVALwhen 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
NanoarrowIpcSharedDictionaryValueTypestest initialises dictionaries for two fields with id 0, first bothstring, thenstringandlarge_string. It expects success and thenEINVAL. Without the fix the second case succeeds. I also read the stream that crashed throughArrowIpcArrayStreamReader. It now fails with the new message instead of reading out of bounds.Found by fuzzing the IPC reader 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