Skip to content

Pad the buffer an Azure read owns with PADDING_FOR_SIMD - #127593

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:fix-azure-read-buffer-simd-padding
Oct 28, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:fix-azure-read-buffer-simd-padding

Conversation

@azat

@azat azat commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The copy to it can be done via memcpySmallAllowReadWriteOverflow15(), when it is not driven by external buffer it will lead to UB

CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127478&sha=8b81289f3121cdeb7c7fedada772e99e6a7e6bcd&name_0=PR&name_1=Stress%20test%20%28amd_asan_ubsan%29

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Pad the buffer an Azure read owns with PADDING_FOR_SIMD


Workflow [PR]
Sync PR [sync-upstream/pr/127593]

Version info

  • Merged into: 26.11.1.874-master (included in 26.11 and later)
  • Backported to: 26.9.35.9

@clickhouse-gh

clickhouse-gh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6b08f62]

Summary: ❌

job_name test_name status info comment
Build profile diff ERROR

AI Review

Summary

The PR replaces the Azure reader's unpadded std::vector<char> with Memory<>, providing the padding required by SIMD copies without increasing the readable capacity. The revised CSV regression test addresses the previous review concern. No remaining correctness findings.

PR Metadata

The Bug Fix category is appropriate and requires a changelog entry. The entry is present, but describes an implementation detail rather than the user-visible fix; see the suggested replacement below.

Missing context / blind spots
  • ⚠️ Focused runtime results for head 6b08f6228929c3ed0127aa49f4522172977be4e6 were unavailable: the relevant ASan and bugfix-validation jobs were pending, and this checkout has no local ClickHouse build. The CI report should confirm execution of the revised test.
Findings

💡 Nits

  • PR description, changelog entry: Explain the user impact instead of naming PADDING_FOR_SIMD. Suggested replacement: “Fix a heap buffer over-read when parsing CSV data from Azure Blob Storage.”
Final Verdict

Status: ✅ Approve. The changelog wording suggestion is nonblocking.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Oct 23, 2026
@azat azat added pr-must-backport Pull request should be backported intentionally. Use this label with great care! and removed pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Oct 23, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). label Oct 23, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing commit 6b08f6228929c3ed0127aa49f4522172977be4e6 with master failed: LogClusterNotReady: the endpoint never became ready.

See the job log for details.

@azat azat added the 🍃 green ci 🌿 Fixing flaky tests in CI label Oct 23, 2026
@azat
azat force-pushed the fix-azure-read-buffer-simd-padding branch from 04ef1ee to 6b08f62 Compare October 27, 2026 10:57
@azat
azat added this pull request to the merge queue Oct 28, 2026
Merged via the queue into ClickHouse:master with commit 6f2ed95 Oct 28, 2026
176 of 178 checks passed
@azat
azat deleted the fix-azure-read-buffer-simd-padding branch October 28, 2026 18:18
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 28, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 3, 2026
…rage-read-buffer-padding

The conflict in ReadBufferFromAzureBlobStorage.h is resolved to master's version: ClickHouse#127593 already
gives the Azure read buffer a padded Memory<> tmp_buffer, so this PR's Azure hunk is dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 3, 2026
ClickHouse#127593 fixed the Azure read buffer's own allocation and covers that read in 05443; on master
cb91252 the leg no longer aborts under ASan, while the three page cache legs still do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
clickhouse-gh Bot added a commit that referenced this pull request Nov 20, 2026
…e-padding

Backport #127593 to 26.10: Pad the buffer an Azure read owns with PADDING_FOR_SIMD
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 20, 2026
@foadl

foadl commented Nov 20, 2026

Copy link
Copy Markdown
Member

@azat heads-up: I'm backporting this to 26.9 (and to the private release/26.10), same as #133226 did for 26.10. The new Azure test 05534_azure_partition_id_with_url_shaped_key from the backports of #129605 reads a TSV blob through ReadBufferFromAzureBlobStorage, and without this padding fix ASan reports a heap-buffer-overflow in readEscapedStringIntoImpl (STID 0988-35bc), which breaks the 26.9 branch CI. Let me know if there's a reason it shouldn't go back.

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 20, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 20, 2026
Backport #127593 to 26.9: Pad the buffer an Azure read owns with PADDING_FOR_SIMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). 🍃 green ci 🌿 Fixing flaky tests in CI pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.9-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants