Repository navigation
Fix undefined behavior from reading uninitialized resolved_snapshot_id in ManifestFileIterator - #99038
Merged
alexey-milovidov merged 1 commit intoMar 16, 2026
Conversation
Contributor
|
Workflow [PR], commit [92e4dd5] Summary: ✅ AI Review1) SummaryThis PR makes a small, targeted fix in 2) Missing context (if any)
3) Findings (by severity)No Blockers or Majors found; the PR looks good. 4) Tests & Evidence
5) ClickHouse Compliance Checklist (Yes/No + short note)
6) Performance & Safety Notes
7) User-Lens Review
8) Final Verdict
|
…id` in `ManifestFileIterator` In `ManifestFileIterator::processRow`, `resolved_snapshot_id` was declared uninitialized. In the `else if` branch for `EXISTING` entries with no `parsed_snapshot_id`, the uninitialized variable was passed to `fmt::format` — undefined behavior. The message also incorrectly implied a snapshot_id existed by printing its value. Fix by removing `resolved_snapshot_id` from the format call and hardcoding `'null'` in the message, consistent with the style of the existing error message in the same function. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
zlareb1
force-pushed
the
fix/iceberg-null-snapshot-id-ub
branch
from
March 11, 2026 15:45
21e8eec to
92e4dd5
Compare
Contributor
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 0.00% (0/8) |
alexey-milovidov
approved these changes
Mar 16, 2026
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.
In ManifestFileIterator::processRow, resolved_snapshot_id is declared as an uninitialized Int64. In the else if branch reached when parsed_snapshot_id is null and the entry status is EXISTING, the uninitialized variable was passed to fmt::format — undefined behavior. The error message was also misleading: it said "has entry with snapshot_id '{}'" but this branch is entered precisely because there is no snapshot_id.
Fix: Remove resolved_snapshot_id from the format call and hardcode 'null' in the message, keeping the same style as the existing error message in the same function:
"Cannot read Iceberg table: manifest file '{}' has entry with snapshot_id 'null' for which write file schema is unknown"
Found via code review on PR #98231.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Note
Low Risk
Very small change limited to an exception message in an error-only code path, reducing undefined behavior risk with minimal functional impact.
Overview
Fixes an undefined-behavior error path in
ManifestFileIterator::processRowwhen a manifest entry isEXISTINGbut has nosnapshot_id.The thrown
ICEBERG_SPECIFICATION_VIOLATIONmessage no longer formats an uninitializedresolved_snapshot_idand instead reports the snapshot id as'null', making the error text accurate and safe.Written by Cursor Bugbot for commit 92e4dd5. This will update automatically on new commits. Configure here.
Version info
26.3.1.707