Cap arrayResize size argument in functions stress test by Algunenano · Pull Request #104254 · ClickHouse/ClickHouse · GitHub
Skip to content

Cap arrayResize size argument in functions stress test#104254

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
Algunenano:cap-array-resize-size-in-stress-test
May 6, 2026
Merged

Cap arrayResize size argument in functions stress test#104254
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
Algunenano:cap-array-resize-size-in-stress-test

Conversation

@Algunenano

@Algunenano Algunenano commented May 6, 2026

Copy link
Copy Markdown
Member

The fuzzer can pick a large random integer as the second argument of arrayResize (anything below MAX_ARRAY_SIZE = 1 << 30), which makes the function spend many seconds filling the result. If a thread happens to start such a call near the end of the run, the unit test trips its 30s shutdown timeout and reports a stuck thread.

Add arrayResize to function_arg_constraints so its size argument is capped, mirroring the existing caps on randomStringUTF8 and arrayWithConstant.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104136&sha=latest&name_0=PR&name_1=Unit+tests+%28asan_ubsan%2C+function_prop_fuzzer%29

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.360

The fuzzer can pick a large random integer as the second argument of
`arrayResize` (anything below `MAX_ARRAY_SIZE = 1 << 30`), which makes
the function spend many seconds filling the result. If a thread happens
to start such a call near the end of the run, the unit test trips its
30s shutdown timeout and reports a stuck thread.

Add `arrayResize` to `function_arg_constraints` so its size argument is
capped, mirroring the existing caps on `randomStringUTF8` and
`arrayWithConstant`.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104136&sha=latest&name_0=PR&name_1=Unit+tests+%28asan_ubsan%2C+function_prop_fuzzer%29

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@clickhouse-gh

clickhouse-gh Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 6, 2026
@alexey-milovidov alexey-milovidov self-assigned this May 6, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Ok. However, it will be a problem for general-purpose coverage-guided fuzzers, as well as for multi-tenant ClickHouse installations. The function should respect the timeout or make heavy calculations impossible. We should implement the fix in a separate PR.

@Algunenano

Copy link
Copy Markdown
Member Author

Ok. However, it will be a problem for general-purpose coverage-guided fuzzers, as well as for multi-tenant ClickHouse installations. The function should respect the timeout or make heavy calculations impossible. We should implement the fix in a separate PR.

Makes sense. AFAICS we haven't hooked the function fuzzer to query limits (memory, timeout, query killed) so it's not detecting those problems, just functions taking too long. We should do it if not and treat them as failures too

@clickhouse-gh

clickhouse-gh Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.00% -0.10%
Functions 91.10% 91.10% +0.00%
Branches 76.60% 76.50% -0.10%

Changed lines: N/A (no coverable changed lines) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov added this pull request to the merge queue May 6, 2026
Merged via the queue into ClickHouse:master with commit 7ba4245 May 6, 2026
165 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 6, 2026
@Algunenano

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants