Repository navigation
Fix LOGICAL_ERROR in geohashesInBox on mixed const arguments and BFloat16 - #107063
alexey-milovidov merged 2 commits into
Conversation
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-6:20260610-192200 |
|
Workflow [PR], commit [82d5a5b] Summary: ✅
AI ReviewSummaryThis PR fixes Final Verdict✅ Approved. No new inline findings. |
|
cc @nikitamikhaylov @scanhex12 could you review? Fixes the |
|
CI fully finished (Finish Workflow passed). Failures, both pre-existing chronic classes, none PR-caused (this PR fixes geohashesInBox LOGICAL_ERROR on mixed const args):
|
|
@groeneai CI has found a HUGE problem in NEVER, listen NEVER miss it again. Always investigate failurs, there is NO such thing as infra outage. Write this down to your memory. |
|
@nikitamikhaylov You're right, and my earlier comment calling this "azure-infra-outage" was wrong. This is a genuine heap-use-after-free, not infra. The secondary It is not caused by this PR. This PR touches only
Root cause (source-grounded): during a horizontal merge the column buffer is freed by Status: no fix PR exists upstream or from us. PR #100185 ("Add assertions in IColumn::mutate to verify deep unique ownership of sub-columns") adds a This PR (geohashesInBox |
|
The fix is correct. The dispatch bug is real: The two red checks are pre-existing trunk flakiness, not caused by this PR (which touches only
So this is good to merge once CI is re-run to clear the flaky checks. |
…at16
geohashesInBox(Float32) crashed with "Unsupported argument types"
LOGICAL_ERROR for two reasons:
1. executeImpl chose the Float32 vs Float64 specialization by inspecting
the runtime class of the first column with checkColumn<ColumnVector<...>>.
When the call mixes constant and non-constant coordinates (so the default
constant folding does not collapse the constants), a constant coordinate
stays wrapped in ColumnConst, which is not a ColumnVector<Float32>. The
dispatch then picked the Float64 path for Float32 data and failed the
inner checkAndGetColumn. Dispatch now uses the declared argument type,
which is correct regardless of constness.
2. The argument validator accepted isFloat, which also admits BFloat16, but
only Float32 and Float64 have an execute specialization, so a BFloat16
coordinate hit the same LOGICAL_ERROR. The validator now requires
isNativeFloat (Float32 or Float64), matching the documented contract, so
BFloat16 is rejected with ILLEGAL_TYPE_OF_ARGUMENT instead of crashing.
Reproducer:
SELECT geohashesInBox(CAST(0. AS Float32), materialize(CAST(0. AS Float32)),
CAST(1. AS Float32), CAST(1. AS Float32), 1);
Closes: ClickHouse#106832
Co-Authored-By: Claude Opus 4.8 <[email protected]>
ec25165 to
526308e
Compare
|
Thanks for confirming. Re-triggered CI (force-pushed an identical-tree commit, no content change) to clear the two red checks, which match your read:
Both should clear on the re-run. |
|
CI re-ran on 526308e and fully finished (Finish Workflow passed). The two red checks flagged in the approval both cleared on this run:
One unrelated red remains: BuzzHouse (amd_debug) errored with So the fix is clean and the only remaining red is a known harness flake. |
|
@groeneai merge with master |
|
@PedroTadim merged current master into the branch (merge commit |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 12/12 (100.00%) · Uncovered code |
CI finish ledger — 82d5a5bCI fully finished on the fresh master-merge head (Finish Workflow = success; all builds, functional, integration, stress, AST fuzzer, BuzzHouse, unit tests green). The two reds from earlier runs (the chronic
Session id: cron:our-pr-ci-monitor:20260701-150000 |
|
Hi — this looks like a backport candidate for |
|
Thanks for the cross-branch verification. Confirming the affected releases are 26.1, 26.2, 26.3, 26.4, 26.5. As an external fork contributor I do not open manual backport PRs. Backports to release branches are driven by the |
…shesInBox-logical-error Fix LOGICAL_ERROR in geohashesInBox on mixed const arguments and BFloat16
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a
LOGICAL_ERROR("Unsupported argument types") in thegeohashesInBoxfunction when its coordinate arguments mixed constant and non-constant values, or when a coordinate was aBFloat16. Mixed const/non-constFloat32arguments now work, andBFloat16arguments are rejected with a clear error.Description
geohashesInBoxaborted withLOGICAL_ERRORon two inputs found by the function fuzzer (issue #106832):geohashesInBox(CAST(0. AS Float32), materialize(CAST(0. AS Float32)), CAST(1. AS Float32), CAST(1. AS Float32), 1). The Float32/Float64 dispatch inspected the runtime column class, but a constant coordinate stays wrapped inColumnConstin a mixed call, so Float32 data was sent to the Float64 path. Dispatch now uses the declared argument type.BFloat16coordinates. The validator accepted anyisFloattype, but only Float32/Float64 are implemented. The validator now requiresisNativeFloat, matching the documented contract, soBFloat16is rejected withILLEGAL_TYPE_OF_ARGUMENT.Added a stateless regression test (
04327_geohashesInBox_const_mix_and_bfloat16).Version info
26.7.1.368(included in26.7and later)