Repository navigation
Description
Describe what's wrong
- Running arrayReverseFill over an array mixing a boolean arrayExists expression with a toLowCardinality(Int) modulo expression on numbers() causes the server to abort with signal 6.
- Found by ClickHouse's AST query fuzzer (clickhouse-client
--query-fuzzer-runs, the continuous master campaign onoraclebuild 26.10.1.1700); crash classfatal. - Did NOT re-trigger as a lone standalone query (0/1 confirm replays): an async / accumulated-state crash, or the captured query was mutation-mangled.
- The fatal record and the run details below are the evidence.
Root cause: Not isolated by the fuzzer; the evidence is below.
Found on master by ClickGap's continuous AST-fuzzer campaign (no PR under review).
Fuzzer run details
- Branch / build:
master(rolling official master build, no PR); sourcemaster_oracle:rolling, flavouroracle. - Signature
8dcc739029659ad3, classfatal; standalone confirm replays 0/1; re-checked on a fresh master build: no_minimized_repro_to_verify.
Analysis details (evidence, affected locations, impact)
Why we believe this is a bug: The server logged a fatal fatal / sanitizer report (STID 8dcc739029659ad3) during AST fuzzing on oracle build 26.10.1.1700.
Affected locations:
See evidence chain.
Impact: Server crash (fatal).
Does it reproduce on most recent release?
Observed on master (oracle build 26.10.1.1700). The standalone replay did not re-trigger it (0/1 confirm replays); re-checked on a fresh master build: no_minimized_repro_to_verify.
How to reproduce
-
Get the
oraclebuild 26.10.1.1700 named under Fuzzer run details. -
Start a server the way the harness did:
./clickhouse server -- --max_server_memory_usage=8000000000 --memory_worker_use_cgroup=0 --memory_worker_dynamic_hard_limit=0- Expected outcome: the server log shows the fatal record under "Error message and/or stacktrace" (signature
8dcc739029659ad3).
Expected behavior
The statement runs, or fails with an ordinary exception. The server stays up and logs no <Fatal> entry or sanitizer report.
Error message and/or stacktrace
Server log at the crash (fatal record / sanitizer report):
2026.10.07 05:50:50.175052 [ 340782 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2026.10.07 05:50:50.175068 [ 340782 ] {} <Fatal> BaseDaemon: (version 26.10.1.1700 (official build), build id: 02EB715EBD427C011B1087728320744F0A0E3BDA, git hash: af72d84f381d6ddac32307ea256727f09a49355f, architecture: aarch64) (from thread 342254) Received signal 6 (internal)
2026.10.07 05:50:50.175072 [ 340782 ] {} <Fatal> BaseDaemon: Signal description: Aborted
2026.10.07 05:50:50.175074 [ 340782 ] {} <Fatal> BaseDaemon: Sent by tkill.
2026.10.07 05:50:50.175088 [ 340782 ] {} <Fatal> BaseDaemon: Stack trace: 0x00000000000874d9 in /usr/lib/aarch64-linux-gnu/libc.so.6 0x000000000003cb3c in /usr/lib/aarch64-linux-gnu/libc.so.6 0x0000000000027e00 in /usr/lib/aarch64-linux-gnu/libc.so.6 0x00000000239fa07c 0x000000001b18a3ec 0x000000001a2ffc7c 0x000000001d91afac 0x000000001d9436d8 0x000000001da0da98 0x000000001b365fb8 0x000000001b365b1c 0x000000001b8b0e64 0x000000001b8ab73c 0x000000001b8c1330 0x000000001b8cd634 0x0000000019c0337c 0x000000001d05937c 0x000000001d077c94 0x00000000229790d8 0x0000000022979670 0x0000000022936df4 0x0000000022934cc0 0x000000000008582c in /usr/lib/aarch64-linux-gnu/libc.so.6 0x00000000000ebb4c in /usr/lib/aarch64-linux-gnu/libc.so.6
2026.10.07 05:50:50.175093 [ 340782 ] {} <Fatal> BaseDaemon: ########################################
2026.10.07 05:50:50.175109 [ 340782 ] {} <Fatal> BaseDaemon: (version 26.10.1.1700 (official build), build id: 02EB715EBD427C011B1087728320744F0A0E3BDA, git hash: af72d84f381d6ddac32307ea256727f09a49355f) (from thread 342254) (query_id: 20de00ab-54fa-4df6-b2bd-5c2f70d96d9b) (query: SELECT arrayReverseFill(x -> (x > 7), [NOT (arrayExists(x -> (toInt256(-2147483648) < x), [__table1.number % NULL]) AND (__table1.number >= 2147483648)), __table1.number % toLowCardinality(255)]), __table1.number AS number FROM numbers(257) AS __table1 LIMIT AFTER min2(number, 100)) Received signal Aborted (6)
2026.10.07 05:50:50.175115 [ 340782 ] {} <Fatal> BaseDaemon: Sent by tkill.
2026.10.07 05:50:50.175121 [ 340782 ] {} <Fatal> BaseDaemon: Stack trace: 0x00000000000874d9 in /usr/lib/aarch64-linux-gnu/libc.so.6 0x000000000003cb3c in /usr/lib/aarch64-linux-gnu/libc.so.6 0x0000000000027e00 in /usr/lib/aarch64-linux-gnu/libc.so.6 0x00000000239fa07c 0x000000001b18a3ec 0x000000001a2ffc7c 0x000000001d91afac 0x000000001d9436d8 0x000000001da0da98 0x000000001b365fb8 0x000000001b365b1c 0x000000001b8b0e64 0x000000001b8ab73c 0x000000001b8c1330 0x000000001b8cd634 0x0000000019c0337c 0x000000001d05937c 0x000000001d077c94 0x00000000229790d8 0x0000000022979670 0x0000000022936df4 0x0000000022934cc0 0x000000000008582c in /usr/lib/aarch64-linux-gnu/libc.so.6 0x00000000000ebb4c in /usr/lib/aarch64-linux-gnu/libc.so.6
2026.10.07 05:50:50.175173 [ 340782 ] {} <Fatal> BaseDaemon: 2. ? @ 0x00000000000874d9
2026.10.07 05:50:50.175183 [ 340782 ] {} <Fatal> BaseDaemon: 3. gsignal @ 0x000000000003cb3c
2026.10.07 05:50:50.175192 [ 340782 ] {} <Fatal> BaseDaemon: 4. conjf128 @ 0x0000000000027e00
2026.10.07 05:50:50.175220 [ 340782 ] {} <Fatal> BaseDaemon: 5. ? @ 0x00000000239fa07c
2026.10.07 05:50:50.175248 [ 340782 ] {} <Fatal> BaseDaemon: 6. DB::ExpressionActions::ExpressionActions(DB::ActionsDAG, DB::ExpressionActionsSettings const&, bool) @ 0x000000001b18a3ec
2026.10.07 05:50:50.175271 [ 340782 ] {} <Fatal> BaseDaemon: 7. std::shared_ptr<DB::ExpressionActions> std::allocate_shared[abi:fqe220101]<DB::ExpressionActions, std::allocator<DB::ExpressionActions>, DB::ActionsDAG, DB::ExpressionActionsSettings const&, 0>(std::allocator<DB::ExpressionActions> const&, DB::ActionsDAG&&, DB::ExpressionActionsSettings const&) @ 0x000000001a2ffc7c
2026.10.07 05:50:50.175283 [ 340782 ] {} <Fatal> BaseDaemon: 8. DB::ExpressionStep::transformPipeline(DB::QueryPipelineBuilder&, DB::BuildQueryPipelineSettings const&) @ 0x000000001d91afac
2026.10.07 05:50:50.175298 [ 340782 ] {} <Fatal> BaseDaemon: 9. DB::ITransformingStep::updatePipeline(std::vector<std::unique_ptr<DB::QueryPipelineBuilder, std::default_delete<DB::QueryPipelineBuilder>>, AllocatorWithMemoryTracking<std::unique_ptr<DB::QueryPipelineBuilder, std::default_delete<DB::QueryPipelineBuilder>>>>, DB::BuildQueryPipelineSettings const&) @ 0x000000001d9436d8
2026.10.07 05:50:50.175309 [ 340782 ] {} <Fatal> BaseDaemon: 10. DB::QueryPlan::buildQueryPipeline(DB::QueryPlanOptimizationSettings const&, DB::BuildQueryPipelineSettings const&, bool) @ 0x000000001da0da98
2026.10.07 05:50:50.175320 [ 340782 ] {} <Fatal> BaseDaemon: 11. DB::InterpreterSelectQueryAnalyzer::buildQueryPipeline() @ 0x000000001b365fb8
2026.10.07 05:50:50.175356 [ 340782 ] {} <Fatal> BaseDaemon: 12. DB::InterpreterSelectQueryAnalyzer::execute() @ 0x000000001b365b1c
2026.10.07 05:50:50.175375 [ 340782 ] {} <Fatal> BaseDaemon: 13. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, boost::intrusive_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::function<void ()>, DB::QueryResultDetails&) @ 0x000000001b8b0e64
2026.10.07 05:50:50.175387 [ 340782 ] {} <Fatal> BaseDaemon: 14. DB::executeQuery(std::basic_string_view<char, std::char_traits<char>>, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001b8ab73c
2026.10.07 05:50:50.175400 [ 340782 ] {} <Fatal> BaseDaemon: 15. DB::executeASTFuzzerQueries(boost::intrusive_ptr<DB::IAST> const&, std::shared_ptr<DB::Context> const&, double, bool) @ 0x000000001b8c1330
2026.10.07 05:50:50.175436 [ 340782 ] {} <Fatal> BaseDaemon: 16. void std::__function::__policy_func<void (DB::QueryPipelineFinalizedInfo const&, std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1l, 1000000l>>>)>::__call_func[abi:fqe220101]<DB::executeQuery(std::basic_string_view<char, std::char_traits<char>>, std::shared_ptr<DB::
Additional context
Found by ClickGap's automated review fuzzing campaign on master (no PR under review), so nobody is tagged. Severity P1 · Finding fuzz_8dcc739029659ad3
Version info
- Resolved by: Fix a server abort for a lambda in a query with
LIMIT AFTERorLIMIT UNTIL#122045 - Merged into:
26.11.1.292-master(included in26.11and later)
Activity
zlareb1 commentedon Oct 8, 2026
@groeneai
groeneai commentedon Oct 8, 2026
This is the same abort as #123971, and my open PR #122045 fixes it.
The "0/1 standalone" result comes from JIT compilation: with default settings, master (debug build at eef0f17) fails runs 1-3 of the logged query with
compareAt is not implemented for Functionand aborts on run 4, whenmin_count_to_compile_expression = 3compiles the projection. It aborts on the first run with:The stack is
front() called on an empty vectorinExpressionActions::linearizeActions<-ExpressionStep::transformPipeline, matching the report.arrayReverseFillandLowCardinalityare not the trigger: the minimal shape from #123971 withLIMIT AFTERinstead ofLIMIT UNTILaborts the same way, andLIMIT 6does not.The CI debug build of #122045 (head c9417bf) returns 256 rows in both modes (6/6 runs with default settings), byte-equal to the lambda-free
SELECT [number % 255, number % 255], number FROM numbers(257) LIMIT AFTER min2(number, 100). I addedCloses #124366to the PR.