Skip to content

Fix: Initialize dummy_input in simsimd_capabilities to fix MSan false positive#10

Merged
alexey-milovidov merged 1 commit intoClickHouse/v6.5.1from
fix-msan-dummy-input-clickhouse
Mar 4, 2026
Merged

Fix: Initialize dummy_input in simsimd_capabilities to fix MSan false positive#10
alexey-milovidov merged 1 commit intoClickHouse/v6.5.1from
fix-msan-dummy-input-clickhouse

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Summary

simsimd_capabilities probes SIMD instructions with an uninitialized dummy_input buffer and n=0. SVE implementations (e.g. simsimd_cos_f32_sve) use do { ... } while loops that always execute the body once. MemorySanitizer doesn't understand SVE predicated loads and reports use-of-uninitialized-value false positives.

The fix simply initializes the buffer to zero: largest_scalar_t dummy_input[1] = {0};

Also sent upstream: ashvardanian#302

… positive

`simsimd_capabilities` probes SIMD instructions with an uninitialized
`dummy_input` buffer and `n=0`. SVE implementations use `do { ... } while`
loops that always execute the body once. MemorySanitizer doesn't understand
SVE predicated loads and reports use-of-uninitialized-value.

Initialize the buffer to zero to silence the false positive.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Mar 4, 2026
@alexey-milovidov alexey-milovidov merged commit 2ccd366 into ClickHouse/v6.5.1 Mar 4, 2026
alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Mar 4, 2026
Point to the merged ClickHouse/v6.5.1 branch which includes the
initialization of `dummy_input` in `simsimd_capabilities`.

ClickHouse/SimSIMD#10

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant