{{ message }}
Bump cld2 to fix MSan use-of-uninitialized-value in detectLanguage#104257
Merged
Conversation
`CLD2::ScriptScanner` had two paths that read one byte past the input buffer when a consumed UTF-8 character ended exactly at `byte_length_`. With a `ColumnString` whose trailing padding bytes are uninitialized, this tripped MSan in `detectLanguageMixed` (and the other `detectLanguage*` functions) and showed up as flaky failures of the `function_prop_fuzzer` unit test on master. Patched in `ClickHouse/cld2#3`. Add a stateless test that exercises the boundary, including the inputs reported on the issue. Closes ClickHouse#103765 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
alexey-milovidov
approved these changes
May 6, 2026
Member
Author
Merged
via the queue into
ClickHouse:master
with commit May 7, 2026
c22bd98
162 of 165 checks passed
1 task
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.

CLD2::ScriptScannerhad two paths that read one byte past the input buffer when a consumed UTF-8 character ended exactly atbyte_length_. With aColumnStringwhose trailing padding bytes are uninitialized, this tripped MSan indetectLanguageMixed(and the otherdetectLanguage*functions) and showed up as flaky failures of thefunction_prop_fuzzerunit test on master.Patched in ClickHouse/cld2#3 — guards the lookahead in
GetOneScriptSpanand the post-loop back-up inGetOneTextSpanagainsttake == byte_length_.Reproduced and confirmed fixed against an MSan build:
Closes #103765
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
MemorySanitizer: use-of-uninitialized-valueindetectLanguage*functions when the input contains a UTF-8 character ending exactly at the buffer boundary.Documentation entry for user-facing changes
Version info
26.5.1.381