Skip to content

Hopefully fix crashes in h3 functions - #93657

Merged
al13n321 merged 5 commits into
masterfrom
ph3il
Jan 14, 2026
Merged

al13n321 merged 5 commits into
masterfrom
ph3il

Conversation

@al13n321

@al13n321 al13n321 commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Backward Incompatible Change

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

Fixed h3 index functions sometimes crashing or getting stuck when called on invalid inputs.


Fuzzing in #93543 found that multiple h3lib functions sometimes do various bad things when called on random inputs:

/// (Specifically, I've seen h3 functions:
///  * hit an `assert` in gridPathCells on this query:
///      SELECT h3Line(7258718383300032567, 7258718383300032567)
///  * get stuck forever in gridDisk on h3kRing(a, 20), where a took some 128 random values;
///    it didn't get stuck when ran on any one of those values, only on the whole column at once.
///  * segfault in getIcosahedronFaces.
/// Some of these failures were inconsistent or depended on other values in the input IColumn,
/// which means there's probably memory corruption.)

I'm hoping that this is caused by lack input validation rather than general bugs in the library. This PR adds validation (using h3lib's isValidCell function) before all calls that take cell indices as input.

Version info

  • Merged into: 26.1.1.492

@clickhouse-gh

clickhouse-gh Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7f6fb25]

Summary: ❌

job_name test_name status info comment
AST fuzzer (amd_debug) failure
Logical error: 'Inconsistent AST formatting in SelectQuery: the query: (STID: 1941-1bfa) FAIL cidb, issue ISSUE EXISTS

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jan 8, 2026
@bharatnc bharatnc self-assigned this Jan 8, 2026
@bharatnc

bharatnc commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Looks good to me, but need to fix style check (seems to be an issue with empty lines).

@al13n321
al13n321 enabled auto-merge January 13, 2026 22:59
@al13n321
al13n321 added this pull request to the merge queue Jan 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jan 13, 2026
@al13n321
al13n321 added this pull request to the merge queue Jan 13, 2026
Merged via the queue into master with commit 0323953 Jan 14, 2026
127 of 128 checks passed
@al13n321
al13n321 deleted the ph3il branch January 14, 2026 00:03
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default 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