AST fuzzer: Fix assertion in TopK serialization#48412
Merged
Conversation
Problem: https://s3.amazonaws.com/clickhouse-test-reports/0/fa5b2bd4a5b02336bca8837c473a7124f8ecedf2/fuzzer_astfuzzerasan/report.html The new assertion in the Varint code was introduced with (*). It rejects values whose serialization cannot be deserialized (and this behavior cannot be changed due to historical reasons). Such values should be exceptionally rare in practice but AST fuzzer managers to trigger them. The fix is similar to (**): Bypass the check by limiting the value to the maximum allowed value. (if AST fuzzer triggers finds more violations of the assertion, we might consider throwing an exception instead) (*) #48154 (**) https://github.com/ClickHouse/ClickHouse/pull/48154/files#diff-653c0a18dfdaa86262c78dc6b25550add0487f165b4ad053e86f530388f6203a
alexey-milovidov
approved these changes
Apr 5, 2023
rschu1ze
added a commit
that referenced
this pull request
Apr 11, 2023
PR #48154 introduced a sanity check in the form of a debug assertion that the input values for VarInt encoding are not too big. Such values should be exceptionally rare in practice but the AST fuzzer managed to trigger the assertion regardless. The strategy to deal with such values until now was to bypass the check by limiting the value to the maximum allowed value (see #48412). Because a new AST Fuzzer failure appeared (#48497) and there may be more failures in future, this PR changes the sanity check from an assert to an exception. Fixes: #48497
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.
Problem:
https://s3.amazonaws.com/clickhouse-test-reports/0/fa5b2bd4a5b02336bca8837c473a7124f8ecedf2/fuzzer_astfuzzerasan/report.html
The new assertion in the Varint code was introduced with #48154. It rejects values whose serialization cannot be deserialized (and this behavior cannot be changed due to historical reasons). Such values should be exceptionally rare in practice but AST fuzzer managers to trigger them.
The fix is similar to this fix: Bypass the check by limiting the value to the maximum allowed value.
(if AST fuzzer triggers finds more violations of the assertion, we might consider throwing an exception instead)
Changelog category (leave one):