src/Functions/DateTimeTransforms.h:990:31: runtime error: signed integer overflow: 9246182400000 * 1000000 cannot be represented in type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/Functions/DateTimeTransforms.h:990:31
2024.11.11 17:08:14.017185 [ 11299 ] {} <Trace> BaseDaemon: Received signal -3
2024.11.11 17:08:14.017495 [ 11975 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2024.11.11 17:08:14.017540 [ 11975 ] {} <Fatal> BaseDaemon: (version 24.11.1.1370, build id: 9CBE4FCCCFAD41A95CB096F2D0755A0581E26C1C, git hash: 5fc259f1d1d26f4520bc1178a76e73eedd235a8f, architecture: x86_64) (from thread 11301) Received signal -3
2024.11.11 17:08:14.017560 [ 11975 ] {} <Fatal> BaseDaemon: Signal description: sanitizer trap
2024.11.11 17:08:14.017574 [ 11975 ] {} <Fatal> BaseDaemon: Sanitizer trap.
2024.11.11 17:08:14.017589 [ 11975 ] {} <Fatal> BaseDaemon: Stack trace: 0x000055557ab45e17 0x000055557afcd727 0x000055556e7f1446 0x000055556e7fb4cd 0x0000555577f1117c 0x0000555577f11048 0x0000555577f10854 0x0000555577f0e336 0x000055556e80e2e6 0x000055556fe03d39 0x0000555584b60463 0x0000555584b5fb3c 0x0000555584b6036c 0x0000555584b61fc9 0x0000555584b638a8 0x00005555868534ef 0x000055558682337f 0x0000555586821ced 0x000055558687174c 0x0000555586815745 0x0000555586812ab9 0x00005555868122ec 0x00005555874878d1 0x0000555587abf04c 0x0000555587abbcfc 0x0000555587ac14b7 0x0000555587ac0d05 0x00005555879ddfa6 0x000055558803601e 0x000055558802faf3 0x000055558a7af9c6 0x000055558a7e54b6 0x000055558e389f38 0x000055558e38b072 0x000055558e2dda61 0x000055558e2d8a2f 0x00007ffff7ca1e2e 0x00007ffff7d33a4c
2024.11.11 17:08:14.017613 [ 11975 ] {} <Fatal> BaseDaemon: ########################################
2024.11.11 17:08:14.017709 [ 11975 ] {} <Fatal> BaseDaemon: (version 24.11.1.1370, build id: 9CBE4FCCCFAD41A95CB096F2D0755A0581E26C1C, git hash: 5fc259f1d1d26f4520bc1178a76e73eedd235a8f) (from thread 11301) (query_id: 0abba2ed-400f-47cc-899a-5c83461768c6) (query: SELECT toStartOfNanosecond(CAST('2263-01-01 00:00:00', 'DateTime64'))) Received signal sanitizer trap (-3)
2024.11.11 17:08:14.017743 [ 11975 ] {} <Fatal> BaseDaemon: Sanitizer trap.
2024.11.11 17:08:14.017787 [ 11975 ] {} <Fatal> BaseDaemon: Stack trace: 0x000055557ab45e17 0x000055557afcd727 0x000055556e7f1446 0x000055556e7fb4cd 0x0000555577f1117c 0x0000555577f11048 0x0000555577f10854 0x0000555577f0e336 0x000055556e80e2e6 0x000055556fe03d39 0x0000555584b60463 0x0000555584b5fb3c 0x0000555584b6036c 0x0000555584b61fc9 0x0000555584b638a8 0x00005555868534ef 0x000055558682337f 0x0000555586821ced 0x000055558687174c 0x0000555586815745 0x0000555586812ab9 0x00005555868122ec 0x00005555874878d1 0x0000555587abf04c 0x0000555587abbcfc 0x0000555587ac14b7 0x0000555587ac0d05 0x00005555879ddfa6 0x000055558803601e 0x000055558802faf3 0x000055558a7af9c6 0x000055558a7e54b6 0x000055558e389f38 0x000055558e38b072 0x000055558e2dda61 0x000055558e2d8a2f 0x00007ffff7ca1e2e 0x00007ffff7d33a4c
2024.11.11 17:08:14.029623 [ 11975 ] {} <Fatal> BaseDaemon: 0. src/Common/StackTrace.cpp:380: StackTrace::tryCapture() @ 0x00000000255f1e17
2024.11.11 17:08:14.044348 [ 11975 ] {} <Fatal> BaseDaemon: 1.0. inlined from src/Common/StackTrace.h:48: StackTrace
2024.11.11 17:08:14.044382 [ 11975 ] {} <Fatal> BaseDaemon: 1. src/Common/SignalHandlers.cpp:186: sanitizerDeathCallback() @ 0x0000000025a79727
2024.11.11 17:08:14.111017 [ 11975 ] {} <Fatal> BaseDaemon: 2. __sanitizer::Die() @ 0x000000001929d446
2024.11.11 17:08:14.141644 [ 11975 ] {} <Fatal> BaseDaemon: 3. ? @ 0x00000000192a74cd
2024.11.11 17:08:14.172236 [ 11975 ] {} <Fatal> BaseDaemon: 4. DB::ToStartOfNanosecondImpl::execute(DB::DateTime64 const&, long, DateLUTImpl const&) @ 0x00000000229bd17c
2024.11.11 17:08:14.202704 [ 11975 ] {} <Fatal> BaseDaemon: 5. void DB::Transformer<DB::DataTypeDateTime64, DB::DataTypeDateTime64, DB::TransformDateTime64<DB::ToStartOfNanosecondImpl> const, false, void*>::vector<DB::PODArray<DB::DateTime64, 4096ul, Allocator<false, false>, 63ul, 64ul>, DB::PODArray<DB::DateTime64, 4096ul, Allocator<false, false>, 63ul, 64ul>>(DB::PODArray<DB::DateTime64, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, DB::PODArray<DB::DateTime64, 4096ul, Allocator<false, false>, 63ul, 64ul>&, DateLUTImpl const&, DB::TransformDateTime64<DB::ToStartOfNanosecondImpl> const&, DB::PODArray<char8_t, 4096ul, Allocator<false, false>, 63ul, 64ul>*, unsigned long) @ 0x00000000229bd048
2024.11.11 17:08:14.233015 [ 11975 ] {} <Fatal> BaseDaemon: 6. COW<DB::IColumn>::immutable_ptr<DB::IColumn> DB::DateTimeTransformImpl<DB::DataTypeDateTime64, DB::DataTypeDateTime64, DB::TransformDateTime64<DB::ToStartOfNanosecondImpl> const, false>::execute<void*>(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, DB::TransformDateTime64<DB::ToStartOfNanosecondImpl> const&) @ 0x00000000229bc854
2024.11.11 17:08:14.263121 [ 11975 ] {} <Fatal> BaseDaemon: 7. DB::FunctionDateOrDateTimeToSomething<DB::DataTypeDateTime64, DB::ToStartOfNanosecondImpl>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x00000000229ba336
2024.11.11 17:08:14.293243 [ 11975 ] {} <Fatal> BaseDaemon: 8. DB::IFunction::executeImplDryRun(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x00000000192ba2e6
2024.11.11 17:08:14.323250 [ 11975 ] {} <Fatal> BaseDaemon: 9. DB::FunctionToExecutableFunctionAdaptor::executeDryRunImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000001a8afd39
2024.11.11 17:08:14.353016 [ 11975 ] {} <Fatal> BaseDaemon: 10. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002f60c463
2024.11.11 17:08:14.382733 [ 11975 ] {} <Fatal> BaseDaemon: 11. DB::IExecutableFunction::defaultImplementationForConstantArguments(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002f60bb3c
2024.11.11 17:08:14.412469 [ 11975 ] {} <Fatal> BaseDaemon: 12. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002f60c36c
2024.11.11 17:08:14.442150 [ 11975 ] {} <Fatal> BaseDaemon: 13. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002f60dfc9
2024.11.11 17:08:14.471804 [ 11975 ] {} <Fatal> BaseDaemon: 14. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002f60f8a8
2024.11.11 17:08:14.542074 [ 11975 ] {} <Fatal> BaseDaemon: 15. src/Analyzer/Resolve/QueryAnalyzer.cpp:3516: DB::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x00000000312ff4ef
2024.11.11 17:08:14.616477 [ 11975 ] {} <Fatal> BaseDaemon: 16. src/Analyzer/Resolve/QueryAnalyzer.cpp:3816: DB::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) @ 0x00000000312cf37f
2024.11.11 17:08:14.690210 [ 11975 ] {} <Fatal> BaseDaemon: 17. src/Analyzer/Resolve/QueryAnalyzer.cpp:3974: DB::QueryAnalyzer::resolveExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool) @ 0x00000000312cdced
2024.11.11 17:08:14.769911 [ 11975 ] {} <Fatal> BaseDaemon: 18. src/Analyzer/Resolve/QueryAnalyzer.cpp:4298: DB::QueryAnalyzer::resolveProjectionExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x000000003131d74c
2024.11.11 17:08:14.846342 [ 11975 ] {} <Fatal> BaseDaemon: 19. src/Analyzer/Resolve/QueryAnalyzer.cpp:5563: DB::QueryAnalyzer::resolveQuery(std::shared_ptr<DB::IQueryTreeNode> const&, DB::IdentifierResolveScope&) @ 0x00000000312c1745
2024.11.11 17:08:14.918969 [ 11975 ] {} <Fatal> BaseDaemon: 20. src/Analyzer/Resolve/QueryAnalyzer.cpp:170: DB::QueryAnalyzer::resolve(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const>) @ 0x00000000312beab9
2024.11.11 17:08:14.920664 [ 11975 ] {} <Fatal> BaseDaemon: 21. src/Analyzer/Resolve/QueryAnalysisPass.cpp:18: DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x00000000312be2ec
2024.11.11 17:08:14.936301 [ 11975 ] {} <Fatal> BaseDaemon: 22. src/Analyzer/QueryTreePassManager.cpp:185: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>) @ 0x0000000031f338d1
2024.11.11 17:08:14.958477 [ 11975 ] {} <Fatal> BaseDaemon: 23. src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:149: DB::(anonymous namespace)::buildQueryTreeAndRunPasses(std::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::Context const> const&, std::shared_ptr<DB::IStorage> const&) @ 0x000000003256b04c
2024.11.11 17:08:14.976439 [ 11975 ] {} <Fatal> BaseDaemon: 24. src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:167: DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&) @ 0x0000000032567cfc
2024.11.11 17:08:14.998613 [ 11975 ] {} <Fatal> BaseDaemon: 25. contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:714: std::__unique_if<DB::InterpreterSelectQueryAnalyzer>::__unique_single std::make_unique[abi:v15007]<DB::InterpreterSelectQueryAnalyzer, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&>(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&) @ 0x000000003256d4b7
2024.11.11 17:08:15.020347 [ 11975 ] {} <Fatal> BaseDaemon: 26.0. inlined from src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:279: operator()
2024.11.11 17:08:15.020383 [ 11975 ] {} <Fatal> BaseDaemon: 26.1. inlined from contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ?
2024.11.11 17:08:15.020442 [ 11975 ] {} <Fatal> BaseDaemon: 26.2. inlined from contrib/llvm-project/libcxx/include/__functional/invoke.h:470: ?
2024.11.11 17:08:15.020500 [ 11975 ] {} <Fatal> BaseDaemon: 26.3. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:235: ?
2024.11.11 17:08:15.020551 [ 11975 ] {} <Fatal> BaseDaemon: 26. contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000003256cd05
2024.11.11 17:08:15.028651 [ 11975 ] {} <Fatal> BaseDaemon: 27.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:848: ?
2024.11.11 17:08:15.028696 [ 11975 ] {} <Fatal> BaseDaemon: 27.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:1197: ?
2024.11.11 17:08:15.028760 [ 11975 ] {} <Fatal> BaseDaemon: 27. src/Interpreters/InterpreterFactory.cpp:382: DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x0000000032489fa6
2024.11.11 17:08:15.074411 [ 11975 ] {} <Fatal> BaseDaemon: 28. src/Interpreters/executeQuery.cpp:1334: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000032ae201e
2024.11.11 17:08:15.124796 [ 11975 ] {} <Fatal> BaseDaemon: 29. src/Interpreters/executeQuery.cpp:1564: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x0000000032adbaf3
2024.11.11 17:08:15.159590 [ 11975 ] {} <Fatal> BaseDaemon: 30. src/Server/TCPHandler.cpp:595: DB::TCPHandler::runImpl() @ 0x000000003525b9c6
2024.11.11 17:08:15.210883 [ 11975 ] {} <Fatal> BaseDaemon: 31. src/Server/TCPHandler.cpp:2528: DB::TCPHandler::run() @ 0x00000000352914b6
2024.11.11 17:08:15.213153 [ 11975 ] {} <Fatal> BaseDaemon: 32. base/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x0000000038e35f38
2024.11.11 17:08:15.216449 [ 11975 ] {} <Fatal> BaseDaemon: 33. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x0000000038e37072
2024.11.11 17:08:15.220054 [ 11975 ] {} <Fatal> BaseDaemon: 34. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x0000000038d89a61
2024.11.11 17:08:15.223368 [ 11975 ] {} <Fatal> BaseDaemon: 35. base/poco/Foundation/src/Thread_POSIX.cpp:335: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000038d84a2f
2024.11.11 17:08:15.223525 [ 11975 ] {} <Fatal> BaseDaemon: Integrity check of the executable skipped because the reference checksum could not be read.
2024.11.11 17:08:16.384801 [ 11941 ] {} <Trace> SystemLog (system.crash_log): Flushing system log, 1 entries to flush up to offset 1
2024.11.11 17:08:16.384871 [ 11941 ] {} <Debug> SystemLog (system.crash_log): Creating new table system.crash_log for CrashLog
2024.11.11 17:08:16.384917 [ 11975 ] {} <Fatal> BaseDaemon: Changed settings: allow_changing_replica_until_first_data_packet = true, allow_reorder_prewhere_conditions = 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_nonconst_timezone_arguments = true, allow_nondeterministic_optimize_skip_unused_shards = true, allow_distributed_ddl = true, allow_suspicious_codecs = true, enable_zstd_qat_codec = true, allow_push_predicate_when_subquery_contains_with = true, allow_custom_error_code_in_throwif = true, allow_ddl = true, allow_hyperscan = true, allow_simdjson = true, allow_introspection_functions = true, allow_execute_multiif_columnar = true, allow_drop_detached = true, allow_materialized_view_with_bad_select = true, allow_settings_after_format_in_insert = true, allow_nondeterministic_mutations = true, allow_non_metadata_alters = true, allow_experimental_kafka_offsets_storage_in_keeper = true, allow_aggregate_partitions_independently = true, allow_prefetched_read_pool_for_remote_filesystem = true, allow_prefetched_read_pool_for_local_filesystem = true, allow_unrestricted_reads_from_keeper = true, allow_deprecated_database_ordinary = true, allow_deprecated_syntax_for_merge_tree = true, allow_asynchronous_read_from_io_pool_for_merge_tree = true, allow_get_client_http_header = true, allow_create_index_without_type = true, allow_named_collection_override_by_default = true, allow_deprecated_error_prone_window_functions = true, allow_deprecated_snowflake_conversion_functions = true, allow_experimental_parallel_reading_from_replicas = 1, 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_vector_similarity_index = true, allow_experimental_variant_type = true, allow_experimental_dynamic_type = true, allow_experimental_json_type = true, allow_experimental_codecs = true, allow_experimental_shared_set_join = true, allow_experimental_join_right_table_sorting = true, allow_statistics_optimize = true, allow_experimental_statistics = true, allow_archive_path_syntax = true, allow_experimental_inverted_index = true, allow_experimental_full_text_index = true, allow_experimental_join_condition = true, allow_experimental_live_view = true, allow_experimental_window_view = true, allow_experimental_database_materialized_mysql = true, allow_experimental_database_materialized_postgresql = true, allow_experimental_query_deduplication = true, allow_experimental_s3queue = true, enable_deflate_qpl_codec = true, type_json_skip_duplicated_paths = true
Describe the bug
UBSAN reports an overflow in
toStartOfNanosecondfunction when the date is large enough. The error is not shown in the Fiddle, but the date goes back to 1900.How to reproduce
Run:
https://fiddle.clickhouse.com/781c3487-09c1-4fd2-b6c2-db1087c62789
Stack trace: