Skip to content

Check stack size more frequently on Darwin due to smaller default stack - #102645

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:darwin_stack
Apr 21, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:darwin_stack

Conversation

@Algunenano

@Algunenano Algunenano commented Apr 14, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Check stack size more frequently on Darwin due to smaller default stack

Fixes 02985_parser_check_stack_size triggering SIGILL on Darwin

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.1101

@clickhouse-gh

clickhouse-gh Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9302414]

Summary: ❌

job_name test_name status info comment
AST fuzzer (arm_asan_ubsan) failure
UndefinedBehaviorSanitizer: undefined behavior (STID: 3050-3ecb) FAIL cidb

AI Review

Summary

This PR changes IParser::Pos::increaseDepth to run checkStackSize every 128 recursion levels on Darwin (instead of 8192), aligning with platforms that have smaller/default stack constraints. I reviewed the full change and did not find correctness, safety, compatibility, or performance issues that require code changes.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 90.90% 90.90% +0.00%
Branches 76.60% 76.60% +0.00%

Changed lines: 100.00% (1/1) · Uncovered code

Full report · Diff report

@thevar1able thevar1able self-assigned this Apr 14, 2026
@Algunenano
Algunenano enabled auto-merge April 16, 2026 02:04
@tavplubix

Copy link
Copy Markdown
Member

AST fuzzer - #102462

@Algunenano
Algunenano added this pull request to the merge queue Apr 21, 2026
Merged via the queue into ClickHouse:master with commit a97eb2f Apr 21, 2026
160 of 162 checks passed
@Algunenano
Algunenano deleted the darwin_stack branch April 21, 2026 11:35
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 21, 2026
@clickgapai

Copy link
Copy Markdown
Contributor

Hi — this PR may need backporting to 26.3 (LTS), 26.2, 26.1, 25.8 (LTS), but no backport label was found.

Affected code: IParser::Pos::increaseDepth stack check frequency conditional — core code present in all supported branches.

Why: This fixes a real crash (SIGILL from stack overflow) on Darwin during parsing of deeply nested expressions. The check_frequency code in IParser.h predates all supported branches. While macOS is not a primary production platform, it is used for development and CI, and stack overflow crashes are serious.

If this should be backported, consider adding pr-must-backport or a version-specific label (e.g. v26.3-must-backport). Ignore this if backporting is not applicable.

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

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

5 participants