-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Don't set temporary_files_buffer_size to 0 (SEGV) #88900
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecrashCrash / segfault / abortCrash / segfault / abortfuzzProblem found by one of the fuzzersProblem found by one of the fuzzers
Description
Describe the bug
Easy to reproduce.
How to reproduce
Run:
CREATE TABLE t0 (c0 Int) ENGINE = Memory();
INSERT INTO TABLE t0 (c0) VALUES (1);
SELECT c0 FROM t0 GROUP BY c0 SETTINGS max_bytes_before_external_group_by = 1, temporary_files_buffer_size = 0, group_by_two_level_threshold = 1;Error message and/or stacktrace
Stack trace:
2025.10.22 16:05:08.997069 [ 347509 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2025.10.22 16:05:08.997087 [ 347509 ] {} <Fatal> BaseDaemon: (version 25.10.1.3748 (official build), build id: F57349B1F1F90D6D68F850E28774D0038ECC1926, git hash: 7c6333b5daf3889ada17cc9e096bc5129c483d91, architecture: x86_64) (from thread 348224) Received signal 11
2025.10.22 16:05:08.997092 [ 347509 ] {} <Fatal> BaseDaemon: Signal description: Segmentation fault
2025.10.22 16:05:08.997098 [ 347509 ] {} <Fatal> BaseDaemon: Address: NULL pointer. Access: write. Address not mapped to object.
2025.10.22 16:05:08.997115 [ 347509 ] {} <Fatal> BaseDaemon: Stack trace: 0x00005fa48f386da5 0x00005fa48f388adb 0x00005fa48ae96fcc 0x00005fa48adf6dd0 0x00005fa48adf5df6 0x00005fa48f65449c 0x00005fa48f651a9c 0x00005fa48f3d5150 0x00005fa48f3c6ed8 0x00005fa48f3c74e9 0x00005fa48f3c8583 0x00005fa485a2fd13 0x00005fa485a363e6 0x00005fa485a2d1a6 0x00005fa485a33bc0 0x00007117d96a27f1 0x00007117d9733b5c
2025.10.22 16:05:08.997124 [ 347509 ] {} <Fatal> BaseDaemon: ########################################
2025.10.22 16:05:08.997193 [ 347509 ] {} <Fatal> BaseDaemon: (version 25.10.1.3748 (official build), build id: F57349B1F1F90D6D68F850E28774D0038ECC1926, git hash: 7c6333b5daf3889ada17cc9e096bc5129c483d91) (from thread 348224) (query_id: eae752c9-2862-4c1c-8d00-f7d776f2f88d) (query: SELECT c0 FROM t0 GROUP BY c0 SETTINGS max_bytes_before_external_group_by = 1, temporary_files_buffer_size = 0, group_by_two_level_threshold = 1;) Received signal Segmentation fault (11)
2025.10.22 16:05:08.997220 [ 347509 ] {} <Fatal> BaseDaemon: Address: NULL pointer. Access: write. Address not mapped to object.
2025.10.22 16:05:08.997248 [ 347509 ] {} <Fatal> BaseDaemon: Stack trace: 0x00005fa48f386da5 0x00005fa48f388adb 0x00005fa48ae96fcc 0x00005fa48adf6dd0 0x00005fa48adf5df6 0x00005fa48f65449c 0x00005fa48f651a9c 0x00005fa48f3d5150 0x00005fa48f3c6ed8 0x00005fa48f3c74e9 0x00005fa48f3c8583 0x00005fa485a2fd13 0x00005fa485a363e6 0x00005fa485a2d1a6 0x00005fa485a33bc0 0x00007117d96a27f1 0x00007117d9733b5c
2025.10.22 16:05:09.002201 [ 347509 ] {} <Fatal> BaseDaemon: 3.0. inlined from src/IO/VarInt.h:32: DB::writeVarUInt(unsigned long, DB::WriteBuffer&)
2025.10.22 16:05:09.002239 [ 347509 ] {} <Fatal> BaseDaemon: 3. src/Core/BlockInfo.cpp:31: DB::BlockInfo::write(DB::WriteBuffer&, unsigned long) const @ 0x000000001ea7dda5
2025.10.22 16:05:09.012773 [ 347509 ] {} <Fatal> BaseDaemon: 4. src/Formats/NativeWriter.cpp:122: DB::NativeWriter::write(DB::Block const&) @ 0x000000001ea7fadb
2025.10.22 16:05:09.436258 [ 347509 ] {} <Fatal> BaseDaemon: 5. src/Interpreters/Aggregator.cpp:1930: void DB::Aggregator::writeToTemporaryFileImpl<DB::AggregationMethodOneNumber<unsigned int, TwoLevelHashMapTable<unsigned long, HashMapCell<unsigned long, char*, HashCRC32<unsigned long>, HashTableNoState, PairNoInit<unsigned long, char*>>, HashCRC32<unsigned long>, TwoLevelHashTableGrower<8ul>, Allocator<true, true>, HashMapTable>, true, false>>(DB::AggregatedDataVariants&, DB::AggregationMethodOneNumber<unsigned int, TwoLevelHashMapTable<unsigned long, HashMapCell<unsigned long, char*, HashCRC32<unsigned long>, HashTableNoState, PairNoInit<unsigned long, char*>>, HashCRC32<unsigned long>, TwoLevelHashTableGrower<8ul>, Allocator<true, true>, HashMapTable>, true, false>&, DB::TemporaryBlockStreamHolder&) const @ 0x000000001a58dfcc
2025.10.22 16:05:09.853397 [ 347509 ] {} <Fatal> BaseDaemon: 6. src/Interpreters/Aggregator.cpp:1788: DB::Aggregator::writeToTemporaryFile(DB::AggregatedDataVariants&, unsigned long) const @ 0x000000001a4eddd0
2025.10.22 16:05:10.268638 [ 347509 ] {} <Fatal> BaseDaemon: 7. src/Interpreters/Aggregator.cpp:1756: DB::Aggregator::executeOnBlock(std::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn>>>, unsigned long, unsigned long, DB::AggregatedDataVariants&, std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*>>&, std::vector<std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*>>, std::allocator<std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*>>>>&, bool&) const @ 0x000000001a4ecdf6
2025.10.22 16:05:10.293646 [ 347509 ] {} <Fatal> BaseDaemon: 8. src/Processors/Transforms/AggregatingTransform.cpp:765: DB::AggregatingTransform::consume(DB::Chunk) @ 0x000000001ed4b49c
2025.10.22 16:05:10.316747 [ 347509 ] {} <Fatal> BaseDaemon: 9. src/Processors/Transforms/AggregatingTransform.cpp:723: DB::AggregatingTransform::work() @ 0x000000001ed48a9c
2025.10.22 16:05:10.321443 [ 347509 ] {} <Fatal> BaseDaemon: 10.0. inlined from src/Processors/Executors/ExecutionThreadContext.cpp:53: DB::executeJob(DB::ExecutingGraph::Node*, DB::ReadProgressCallback*)
2025.10.22 16:05:10.321467 [ 347509 ] {} <Fatal> BaseDaemon: 10. src/Processors/Executors/ExecutionThreadContext.cpp:102: DB::ExecutionThreadContext::executeTask() @ 0x000000001eacc150
2025.10.22 16:05:10.338106 [ 347509 ] {} <Fatal> BaseDaemon: 11. src/Processors/Executors/PipelineExecutor.cpp:351: DB::PipelineExecutor::executeStepImpl(unsigned long, DB::IAcquiredSlot*, std::atomic<bool>*) @ 0x000000001eabded8
2025.10.22 16:05:10.353859 [ 347509 ] {} <Fatal> BaseDaemon: 12. src/Processors/Executors/PipelineExecutor.cpp:279: DB::PipelineExecutor::executeSingleThread(unsigned long, DB::IAcquiredSlot*) @ 0x000000001eabe4e9
2025.10.22 16:05:10.372456 [ 347509 ] {} <Fatal> BaseDaemon: 13.0. inlined from src/Processors/Executors/PipelineExecutor.cpp:565: operator()
2025.10.22 16:05:10.372489 [ 347509 ] {} <Fatal> BaseDaemon: 13.1. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:149: decltype(std::declval<DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0&>()()) std::__invoke[abi:se190107]<DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0&>(DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0&)
2025.10.22 16:05:10.372509 [ 347509 ] {} <Fatal> BaseDaemon: 13.2. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:224: void std::__invoke_void_return_wrapper<void, true>::__call[abi:se190107]<DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0&>(DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0&)
2025.10.22 16:05:10.372526 [ 347509 ] {} <Fatal> BaseDaemon: 13.3. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:210: ?
2025.10.22 16:05:10.372568 [ 347509 ] {} <Fatal> BaseDaemon: 13. contrib/llvm-project/libcxx/include/__functional/function.h:610: ? @ 0x000000001eabf583
2025.10.22 16:05:10.383695 [ 347509 ] {} <Fatal> BaseDaemon: 14.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:716: ?
2025.10.22 16:05:10.383722 [ 347509 ] {} <Fatal> BaseDaemon: 14.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:989: ?
2025.10.22 16:05:10.383748 [ 347509 ] {} <Fatal> BaseDaemon: 14. src/Common/ThreadPool.cpp:802: ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::worker() @ 0x0000000015126d13
2025.10.22 16:05:10.395927 [ 347509 ] {} <Fatal> BaseDaemon: 15.0. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:117: decltype(*std::declval<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&>().*std::declval<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)()>()()) std::__invoke[abi:se190107]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&, void>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&)
2025.10.22 16:05:10.395967 [ 347509 ] {} <Fatal> BaseDaemon: 15.1. inlined from contrib/llvm-project/libcxx/include/tuple:1354: decltype(auto) std::__apply_tuple_impl[abi:se190107]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&, 0ul>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&, std::__tuple_indices<0ul>)
2025.10.22 16:05:10.395977 [ 347509 ] {} <Fatal> BaseDaemon: 15.2. inlined from contrib/llvm-project/libcxx/include/tuple:1358: decltype(auto) std::apply[abi:se190107]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&)
2025.10.22 16:05:10.396036 [ 347509 ] {} <Fatal> BaseDaemon: 15. src/Common/ThreadPool.h:312: ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()::operator()() @ 0x000000001512d3e6
2025.10.22 16:05:10.406111 [ 347509 ] {} <Fatal> BaseDaemon: 16.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:716: ?
2025.10.22 16:05:10.406141 [ 347509 ] {} <Fatal> BaseDaemon: 16.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:989: ?
2025.10.22 16:05:10.406148 [ 347509 ] {} <Fatal> BaseDaemon: 16. src/Common/ThreadPool.cpp:812: ThreadPoolImpl<std::thread>::ThreadFromThreadPool::worker() @ 0x00000000151241a6
2025.10.22 16:05:10.426018 [ 347509 ] {} <Fatal> BaseDaemon: 17.0. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:117: decltype(*std::declval<ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>().*std::declval<void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)()>()()) std::__invoke[abi:se190107]<void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*, void>(void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*&&)
2025.10.22 16:05:10.426046 [ 347509 ] {} <Fatal> BaseDaemon: 17.1. inlined from contrib/llvm-project/libcxx/include/__thread/thread.h:192: void std::__thread_execute[abi:se190107]<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*, 2ul>(std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>&, std::__tuple_indices<2ul>)
2025.10.22 16:05:10.426055 [ 347509 ] {} <Fatal> BaseDaemon: 17. contrib/llvm-project/libcxx/include/__thread/thread.h:201: void* std::__thread_proxy[abi:se190107]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x000000001512abc0
2025.10.22 16:05:10.426084 [ 347509 ] {} <Fatal> BaseDaemon: 18. start_thread @ 0x00000000000a27f1
2025.10.22 16:05:10.426107 [ 347509 ] {} <Fatal> BaseDaemon: 19. __GI___clone3 @ 0x0000000000133b5c
2025.10.22 16:05:10.645643 [ 347509 ] {} <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 2FEDF6801FE081BAEB00E6ABE940F066)
2025.10.22 16:05:10.654786 [ 347509 ] {} <Fatal> BaseDaemon: Report this error to https://github.com/ClickHouse/ClickHouse/issues
2025.10.22 16:05:10.654951 [ 347509 ] {} <Fatal> BaseDaemon: Changed settings: s3_truncate_on_insert = true, azure_truncate_on_insert = true, allow_suspicious_low_cardinality_types = true, allow_suspicious_fixed_string_types = true, allow_suspicious_indices = true, allow_suspicious_ttl_expressions = true, allow_suspicious_variant_types = true, allow_suspicious_primary_key = true, allow_suspicious_types_in_group_by = true, allow_suspicious_types_in_order_by = true, allow_not_comparable_types_in_order_by = true, allow_not_comparable_types_in_comparison_functions = true, group_by_two_level_threshold = 1, enable_positional_arguments = true, allow_nonconst_timezone_arguments = true, allow_experimental_time_time64_type = true, allow_nondeterministic_optimize_skip_unused_shards = true, allow_distributed_ddl = true, allow_suspicious_codecs = true, enable_zstd_qat_codec = true, enable_deflate_qpl_codec = true, max_bytes_before_external_group_by = 1, max_execution_time = 60., temporary_files_buffer_size = 0, allow_custom_error_code_in_throwif = true, allow_ddl = true, allow_introspection_functions = true, allow_drop_detached = true, enable_lightweight_delete = true, allow_materialized_view_with_bad_select = true, allow_settings_after_format_in_insert = true, allow_nondeterministic_mutations = true, allow_non_metadata_alters = true, enable_lightweight_update = true, allow_experimental_kafka_offsets_storage_in_keeper = true, engine_file_truncate_on_insert = true, database_replicated_allow_replicated_engine_arguments = 1, allow_experimental_correlated_subqueries = true, keeper_max_retries = 15, enable_order_by_all = true, allow_named_collection_override_by_default = true, allow_experimental_delta_lake_writes = true, parallel_replicas_for_non_replicated_merge_tree = true, allow_experimental_database_iceberg = true, allow_experimental_database_unity_catalog = true, allow_experimental_database_glue_catalog = true, allow_experimental_analyzer = true, allow_experimental_materialized_postgresql_table = true, allow_experimental_funnel_functions = true, allow_experimental_nlp_functions = true, allow_experimental_hash_functions = true, allow_experimental_object_type = true, allow_experimental_time_series_table = true, allow_experimental_codecs = true, allow_experimental_join_right_table_sorting = true, allow_experimental_statistics = true, allow_experimental_full_text_index = true, allow_experimental_live_view = true, allow_experimental_database_materialized_postgresql = true, allow_experimental_qbit_type = true, allow_experimental_database_hms_catalog = true, allow_experimental_insert_into_iceberg = true, allow_experimental_iceberg_compaction = true, allow_experimental_bfloat16_type = true, allow_experimental_inverted_index = true, allow_experimental_vector_similarity_index = true, allow_experimental_join_condition = true, allow_experimental_variant_type = true, allow_experimental_dynamic_type = true, allow_experimental_json_type = true, allow_experimental_shared_set_join = true, type_json_skip_duplicated_paths = true, input_format_parquet_allow_geoparquet_parser = true
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecrashCrash / segfault / abortCrash / segfault / abortfuzzProblem found by one of the fuzzersProblem found by one of the fuzzers