Skip to content

Fix MSan integration tests related to Azure and SSH protocol - #97053

Merged
alexey-milovidov merged 7 commits into
masterfrom
fix-msan-integration-tests
Feb 16, 2026
Merged

alexey-milovidov merged 7 commits into
masterfrom
fix-msan-integration-tests

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 16, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC) or LOGICAL_ERROR

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

Azure, SSH, and Arrow Flight had reads of uninitialized memory. Delta Lake cannot work under MSan at all due to Rust.

Version info

  • Merged into: 26.2.1.795

alexey-milovidov and others added 3 commits February 16, 2026 01:20
Update the OpenSSL submodule with `__msan_unpoison` annotations in
`ossl_x25519` and `ossl_x25519_public_from_private`. This fixes
the MSan false positive caused by assembly-based X25519 scalar
multiplication (`x25519-x86_64.s`) whose memory writes are invisible
to MSan.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Remove `setApplicationType` call from `ClientEmbedded::run`: the
  application type is already set on the shared context at server
  startup, so writing it again from a worker thread races with
  concurrent readers (e.g. `SystemLog` flushing via `getApplicationType`).

- Initialize `query_kind` member in `ClientBase` to
  `ClientInfo::QueryKind::INITIAL_QUERY`: in the regular client flow
  it is set from command-line options, but `ClientEmbedded` never sets
  it, so `initClientContext` reads an uninitialized value.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96996&sha=c83b21f3ae8ef16ea3d11e02eb4a38f026da4265&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20flaky%20check%29
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96996&sha=c83b21f3ae8ef16ea3d11e02eb4a38f026da4265&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix use-of-uninitialized-value in Azure `PocoAzureHTTPClient::getByteLatencyType`:
  the retry context value was stored as `int` (4 bytes) via `WithValue(..., 0)` but
  read as `size_t` (8 bytes) via `TryGetValue<size_t>`, leaving 4 bytes uninitialized.
  Changed to `size_t{0}`.

- Initialize `is_internal` member in `QueryLogElement` to fix potential MSan report
  during system log flushing.

- Skip `test_storage_delta` and `test_storage_delta_disks` under MSan because they
  use Rust code (delta-kernel-rs) which is not instrumented.

https://play.clickhouse.com/play?user=play&run=1#U0VMRUNUIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSBjaGVja19uYW1lIExJS0UgJ0ludGVncmF0aW9uJScKICAgIEFORCBjaGVja19zdGFydF90aW1lID49IG5vdygpIC0gSU5URVJWQUwgMjQgSE9VUgogICAgQU5EIChoZWFkX3JlZiA9ICdtYXN0ZXInIEFORCBzdGFydHNXaXRoKGhlYWRfcmVwbywgJ0NsaWNrSG91c2UvJykpCiAgICBBTkQgdGVzdF9zdGF0dXMgIT0gJ1NLSVBQRUQnCiAgICBBTkQgKHRlc3Rfc3RhdHVzIExJS0UgJ0YlJyBPUiB0ZXN0X3N0YXR1cyBMSUtFICdFJScpCiAgICBBTkQgY2hlY2tfc3RhdHVzICE9ICdzdWNjZXNzJwogICAgQU5EIGNoZWNrX25hbWUgTk9UIExJS0UgJ2xpYkZ1enplciUnCiAgICBBTkQgY2hlY2tfbmFtZSAhPSAnQ2xpY2tIb3VzZSBLZWVwZXIgSmVwc2VuJwpPUkRFUiBCWSBjaGVja19uYW1lLCB0ZXN0X25hbWUsIGNoZWNrX3N0YXJ0X3RpbWU=

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [28c9495]

Summary: ❌

job_name test_name status info comment
Bugfix validation (integration tests) failure
test_storage_delta/test.py::test_single_log_file[1-s3] FAIL cidb
test_storage_delta/test.py::test_single_log_file[0-s3] FAIL cidb
test_storage_delta/test.py::test_single_log_file[0-azure] FAIL cidb
test_storage_delta/test.py::test_single_log_file[1-local] FAIL cidb
test_storage_delta/test.py::test_partition_by[1-s3] FAIL cidb
test_storage_delta/test.py::test_partition_by[0-s3] FAIL cidb
test_storage_delta/test.py::test_partition_by[0-azure] FAIL cidb
test_storage_delta/test.py::test_partition_by[1-local] FAIL cidb
test_storage_delta/test.py::test_checkpoint[1-s3] FAIL cidb
test_storage_delta/test.py::test_checkpoint[0-s3] FAIL cidb
161 more test cases not shown
BuzzHouse (amd_tsan) failure
Logical error: Block structure mismatch in A stream: different columns: (STID: 0993-23fd) FAIL cidb

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix submodule changed At least one submodule changed in this PR. pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Feb 16, 2026
…h `USE_DELTA_KERNEL_RS` and skip flaky tests

The `deltaLakeAzureCluster` table function was registered under `#if USE_AZURE_BLOB_STORAGE`
but the corresponding `DeltaLakeAzure` storage engine requires `USE_DELTA_KERNEL_RS`. This
mismatch caused a `LOGICAL_ERROR` exception when the table function tried to look up its
engine for access checking, crashing the server in debug builds.

Fixes:
- Add `USE_DELTA_KERNEL_RS` guard to `deltaLakeAzureCluster` registration (.cpp, .h, template)
- Change `getSourceAccessObject` from `LOGICAL_ERROR` to `UNKNOWN_STORAGE` for unknown engines
- Fix copy-paste in documentation: "Iceberg" → "DeltaLake" for `deltaLakeAzureCluster`
- Skip Delta Lake tests when `DeltaLake` engine is not available (query `system.table_engines`)
- Conditionally handle Delta Lake entries in `test_mask_sensitive_info` based on engine availability
- Skip timing-sensitive and memory-measurement tests under MSan:
  `test_ttl_compatibility`, `test_memory_limit_success`, `test_async_query_sending`,
  `test_when_s3_timeout_at_listing`

Co-Authored-By: Claude Opus 4.6 <[email protected]>
download_options.Range = {static_cast<int64_t>(range_begin), n};
Azure::Core::Context azure_context = Azure::Core::Context().WithValue(PocoAzureHTTPClient::getSDKContextKeyForBufferRetry(), 0);

Azure::Core::Context azure_context = Azure::Core::Context().WithValue(PocoAzureHTTPClient::getSDKContextKeyForBufferRetry(), size_t{0});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alesapin, here is the bug.

- `test_mask_sensitive_info::test_create_table`: Fix expected error code
  from `UNKNOWN_TABLE` to `UNKNOWN_STORAGE` when `DeltaLake` engine is
  not available.
- `test_max_bytes_ratio_before_external_group_by`: Skip under MSan due
  to increased memory usage hitting the server memory limit.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97053&sha=f9ec529e4ff983e3a9a1c0bba4b5b091aba147e0&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%203%2F6%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 16, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! 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 submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants