{{ message }}
Cherry pick #118286 to 26.3: Fix the nightly libFuzzer OOM and timeout - #118355
Open
robot-ch-test-poll wants to merge 2 commits into
Open
Cherry pick #118286 to 26.3: Fix the nightly libFuzzer OOM and timeout#118355robot-ch-test-poll wants to merge 2 commits into
robot-ch-test-poll wants to merge 2 commits into
Conversation
The `NightlyFuzzers` run at 8d8dd30 failed with two findings. `data_type_deserialization_fuzzer` ran out of memory (used 8235 Mb, limit 8192 Mb) with 5.5 GB of live heap in `DateLUT::getImplementation`. `cctz` synthesizes a zone for every name of the form `Fixed/UTC±HH:MM:SS` without consulting the time zone database, and accepts any offset up to 24 hours, which is 172801 distinct names. Every name that gets loaded permanently costs ~4.6 MiB in the `DateLUT` cache, and that cache never evicts anything because callers keep bare references into it, so untrusted input could make the server allocate memory that it never gives back: 1 name costs 187 MB of RSS, 180 names cost 989 MB, 600 names cost 2964 MB. Accept only the offsets a time zone can actually have: a whole number of quarters of an hour, no further from UTC than 14 hours. That covers every offset in the time zone database - the last one that was not a multiple of 15 minutes ended in 1972 - and leaves 113 such names, which bounds the cache. `Values::OffsetChangeFactor` already assumes the same granularity for the offset changes within a zone. The `session_timezone` setting validates through the same predicate, so a value cannot be accepted and then fail on every query. `select_parser_fuzzer` hit its 60 second per-input timeout while still replaying its own corpus. Its seed corpus is generated from `tests/queries`, whose largest file is ~380 KB, and without an explicit `max_len` libFuzzer sizes every input after that file. The 334 KB input it timed out on parses in 0.28 s of CPU in a release build, so nothing is wrong with the parser - a query that long just cannot be parsed within 60 seconds by a sanitizer build. Cap the input length at 65536, the same cap `create_parser_fuzzer` already uses. The statistics the report printed for both targets were nonsense - "replaying the initial corpus took 19701 of 140 executed inputs (14072%), leaving -19561 mutations". `parse_libfuzzer_output` split each line before testing it, which strips indentation, so the frames of a sanitizer stack trace were taken for libFuzzer progress lines and the last frame's depth was reported as the number of executed inputs. Anchor the progress line at the start of the line and require its event to be a word: the run above then reports 34930 executed inputs with the rest of its statistics intact. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=8d8dd308b73c4bb8ef921f0b01f6806656054872&name_0=NightlyFuzzers&name_1=libFuzzer%20tests Related: #107459
…lut-oom Fix the nightly libFuzzer OOM and timeout
Member
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.

Original pull-request #118286
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job