Fix use-of-uninitialized-value in quantileDeterministic#81062
Merged
azat merged 1 commit intoClickHouse:masterfrom Jun 1, 2025
Merged
Fix use-of-uninitialized-value in quantileDeterministic#81062azat merged 1 commit intoClickHouse:masterfrom
azat merged 1 commit intoClickHouse:masterfrom
Conversation
Contributor
MSan reports:
Uninitialized value was stored to memory at
0 0xabcb3f7bdd40 in ReservoirSamplerDeterministic<char8_t, (ReservoirSamplerDeterministicOnEmpty)1>::write(DB::WriteBuffer&) const .build-msan/./src/AggregateFunctions/ReservoirSamplerDeterministic.h:198:18
1 0xabcb3f7bdd40 in DB::(anonymous namespace)::QuantileReservoirSamplerDeterministic<char8_t>::serialize(DB::WriteBuffer&) const .build-msan/./src/AggregateFunctions/AggregateFunctionQuantileDeterministic.cpp:57:14
2 0xabcb3f7bdd40 in DB::AggregateFunctionQuantile<char8_t, DB::(anonymous namespace)::QuantileReservoirSamplerDeterministic<char8_t>, DB::NameQuantileDeterministic, true, double, false, false>::serialize(char const*, DB::WriteBuffer&, std::__1::optional<unsigned long>) const .build-msan/./src/AggregateFunctions/AggregateFunctionQuantile.h:242:57
3 0xabcb4ae6e754 in DB::serializeToString(std::__1::shared_ptr<DB::IAggregateFunction const> const&, DB::IColumn const&, unsigned long, unsigned long) .build-msan/./src/DataTypes/Serializations/SerializationAggregateFunction.cpp:102:15
4 0xabcb4ae6e47c in DB::SerializationAggregateFunction::serializeText(DB::IColumn const&, unsigned long, DB::WriteBuffer&, DB::FormatSettings const&) const .build-msan/./src/DataTypes/Serializations/SerializationAggregateFunction.cpp:132:17
Uninitialized value was stored to memory at
0 0xabcb3f7bdd40 in ReservoirSamplerDeterministic<char8_t, (ReservoirSamplerDeterministicOnEmpty)1>::write(DB::WriteBuffer&) const .build-msan/./src/AggregateFunctions/ReservoirSamplerDeterministic.h:198:18
1 0xabcb3f7bdd40 in DB::(anonymous namespace)::QuantileReservoirSamplerDeterministic<char8_t>::serialize(DB::WriteBuffer&) const .build-msan/./src/AggregateFunctions/AggregateFunctionQuantileDeterministic.cpp:57:14
2 0xabcb3f7bdd40 in DB::AggregateFunctionQuantile<char8_t, DB::(anonymous namespace)::QuantileReservoirSamplerDeterministic<char8_t>, DB::NameQuantileDeterministic, true, double, false, false>::serialize(char const*, DB::WriteBuffer&, std::__1::optional<unsigned long>) const .build-msan/./src/AggregateFunctions/AggregateFunctionQuantile.h:242:57
3 0xabcb4ae6e754 in DB::serializeToString(std::__1::shared_ptr<DB::IAggregateFunction const> const&, DB::IColumn const&, unsigned long, unsigned long) .build-msan/./src/DataTypes/Serializations/SerializationAggregateFunction.cpp:102:15
4 0xabcb4ae6e47c in DB::SerializationAggregateFunction::serializeText(DB::IColumn const&, unsigned long, DB::WriteBuffer&, DB::FormatSettings const&) const .build-msan/./src/DataTypes/Serializations/SerializationAggregateFunction.cpp:132:17
The problem is the assigment of the whole pair.
Fixes: ClickHouse#80862
Complete report: https://pastila.clickhouse.com/?0005f20c/c8363f3b9a4205781d88c2f3fe4a0841#19owb1ROpa4VkIUDulFBpw==
f5d6ec4 to
0637bbe
Compare
Michicosun
approved these changes
May 31, 2025
Merged
via the queue into
ClickHouse:master
with commit Jun 1, 2025
22b4cf7
116 of 121 checks passed
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.
MSan reports:
The problem is the assigment of the whole pair.
Fixes: #80862
Complete report: https://pastila.clickhouse.com/?0005f20c/c8363f3b9a4205781d88c2f3fe4a0841#19owb1ROpa4VkIUDulFBpw==
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix use-of-uninitialized-value in quantileDeterministic