Skip to content

Iceberg bad ORDER BY SEGV #93280

@PedroTadim

Description

@PedroTadim

Describe the bug

Easy to reproduce. Related to #93225 ?

How to reproduce

Run:

CREATE TABLE t0 (c0 Int) ENGINE = IcebergLocal(local, path = '/var/lib/clickhouse/user_files/lakehouses/t0') ORDER BY (1); --SEGV

Error message and/or stacktrace

Stack trace:

2025.12.31 13:22:03.407295 [ 3728635 ] {} <Trace> BaseDaemon: Received signal 11
2025.12.31 13:22:03.407349 [ 3728635 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2025.12.31 13:22:03.407365 [ 3728635 ] {} <Fatal> BaseDaemon: (version 26.1.1.223 (official build), build id: C1981702E3C8638712A51925720E6EB49355A4EB, git hash: acd6404111e7930ec240091a3c8c13eb0326c040, architecture: x86_64) (from thread 3728638) Received signal 11
2025.12.31 13:22:03.407373 [ 3728635 ] {} <Fatal> BaseDaemon: Signal description: Segmentation fault
2025.12.31 13:22:03.407378 [ 3728635 ] {} <Fatal> BaseDaemon: Address: 0xf7. Access: read. Address not mapped to object.
2025.12.31 13:22:03.407401 [ 3728635 ] {} <Fatal> BaseDaemon: Stack trace: 0x00005986151f1aff 0x00005986151f4e4e 0x0000598615136ff6 0x000059861303b893 0x0000598614f4d2a1 0x0000598619dea910 0x0000598619dea5c7 0x0000598619de7768 0x0000598619de8f44 0x0000598619a239c4 0x0000598616d1fe09 0x0000598616d18bd0 0x0000598616d268f2 0x00005986170f70e8 0x00005986170f0ad4 0x000059861a92b189 0x000059861a9461e4 0x0000598620dd00ce 0x0000598620dd073b 0x0000598620d70c3f 0x0000598620d6e2cf 0x00007cb3e76a3d64 0x00007cb3e77373bc
2025.12.31 13:22:03.407410 [ 3728635 ] {} <Fatal> BaseDaemon: ########################################
2025.12.31 13:22:03.407498 [ 3728635 ] {} <Fatal> BaseDaemon: (version 26.1.1.223 (official build), build id: C1981702E3C8638712A51925720E6EB49355A4EB, git hash: acd6404111e7930ec240091a3c8c13eb0326c040) (from thread 3728638) (query_id: 90243cee-1f45-45a9-b120-a29959881c6c) (query: CREATE TABLE t0 (c0 Int) ENGINE = IcebergLocal(local, path = '/var/lib/clickhouse/user_files/lakehouses/t0') ORDER BY (2);) Received signal Segmentation fault (11)
2025.12.31 13:22:03.407528 [ 3728635 ] {} <Fatal> BaseDaemon: Address: 0xf7. Access: read. Address not mapped to object.
2025.12.31 13:22:03.407556 [ 3728635 ] {} <Fatal> BaseDaemon: Stack trace: 0x00005986151f1aff 0x00005986151f4e4e 0x0000598615136ff6 0x000059861303b893 0x0000598614f4d2a1 0x0000598619dea910 0x0000598619dea5c7 0x0000598619de7768 0x0000598619de8f44 0x0000598619a239c4 0x0000598616d1fe09 0x0000598616d18bd0 0x0000598616d268f2 0x00005986170f70e8 0x00005986170f0ad4 0x000059861a92b189 0x000059861a9461e4 0x0000598620dd00ce 0x0000598620dd073b 0x0000598620d70c3f 0x0000598620d6e2cf 0x00007cb3e76a3d64 0x00007cb3e77373bc
2025.12.31 13:22:03.466325 [ 3728635 ] {} <Fatal> BaseDaemon: 3. src/Common/typeid_cast.h:0: DB::Iceberg::parseTransformAndColumn(std::shared_ptr<DB::IAST>, unsigned long) @ 0x000000001ab1faff
2025.12.31 13:22:03.519579 [ 3728635 ] {} <Fatal> BaseDaemon: 4. src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp:842: DB::Iceberg::createEmptyMetadataFile(String, DB::ColumnsDescription const&, std::shared_ptr<DB::IAST>, std::shared_ptr<DB::IAST>, std::shared_ptr<DB::Context const>, unsigned long) @ 0x000000001ab22e4e
2025.12.31 13:22:03.573240 [ 3728635 ] {} <Fatal> BaseDaemon: 5. src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp:584: DB::IcebergMetadata::createInitial(std::shared_ptr<DB::IObjectStorage> const&, std::weak_ptr<DB::StorageObjectStorageConfiguration> const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::ColumnsDescription> const&, std::shared_ptr<DB::IAST>, std::shared_ptr<DB::IAST>, bool, std::shared_ptr<DataLake::ICatalog>, DB::StorageID const&) @ 0x000000001aa64ff6
2025.12.31 13:22:03.660583 [ 3728635 ] {} <Fatal> BaseDaemon: 6. src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h:121: DB::DataLakeConfiguration<DB::StorageLocalConfiguration, DB::IcebergMetadata>::create(std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context const>, std::optional<DB::ColumnsDescription> const&, std::shared_ptr<DB::IAST>, std::shared_ptr<DB::IAST>, bool, std::shared_ptr<DataLake::ICatalog>, DB::StorageID const&) @ 0x0000000018969893
2025.12.31 13:22:03.690215 [ 3728635 ] {} <Fatal> BaseDaemon: 7. src/Storages/ObjectStorage/StorageObjectStorage.cpp:155: DB::StorageObjectStorage::StorageObjectStorage(std::shared_ptr<DB::StorageObjectStorageConfiguration>, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context const>, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>, DB::LoadingStrictnessLevel, std::shared_ptr<DataLake::ICatalog>, bool, bool, bool, std::shared_ptr<DB::IAST>, std::shared_ptr<DB::IAST>, bool, bool) @ 0x000000001a87b2a1
2025.12.31 13:22:03.732799 [ 3728635 ] {} <Fatal> BaseDaemon: 8. contrib/llvm-project/libcxx/include/__memory/construct_at.h:38: DB::StorageObjectStorage* std::construct_at[abi:se210105]<DB::StorageObjectStorage, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&, DB::StorageObjectStorage*>(DB::StorageObjectStorage*, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&) @ 0x000000001f718910
2025.12.31 13:22:03.774685 [ 3728635 ] {} <Fatal> BaseDaemon: 9.0. inlined from contrib/llvm-project/libcxx/include/__memory/construct_at.h:46: DB::StorageObjectStorage* std::__construct_at[abi:se210105]<DB::StorageObjectStorage, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&, DB::StorageObjectStorage*>(DB::StorageObjectStorage*, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&)
2025.12.31 13:22:03.774739 [ 3728635 ] {} <Fatal> BaseDaemon: 9.1. inlined from contrib/llvm-project/libcxx/include/__memory/allocator_traits.h:302: void std::allocator_traits<std::allocator<DB::StorageObjectStorage>>::construct[abi:se210105]<DB::StorageObjectStorage, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&, 0>(std::allocator<DB::StorageObjectStorage>&, DB::StorageObjectStorage*, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&)
2025.12.31 13:22:03.774769 [ 3728635 ] {} <Fatal> BaseDaemon: 9.2. inlined from contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:162: __shared_ptr_emplace<std::shared_ptr<DB::StorageObjectStorageConfiguration> &, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context> &, const DB::StorageID &, const DB::ColumnsDescription &, const DB::ConstraintsDescription &, const std::basic_string<char, std::char_traits<char>, std::allocator<char> > &, std::optional<DB::FormatSettings> &, const DB::LoadingStrictnessLevel &, std::shared_ptr<DataLake::ICatalog>, const bool &, bool, bool, std::shared_ptr<DB::IAST> &, std::shared_ptr<DB::IAST> &, std::allocator<DB::StorageObjectStorage>, 0>
2025.12.31 13:22:03.774782 [ 3728635 ] {} <Fatal> BaseDaemon: 9. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:736: std::shared_ptr<DB::StorageObjectStorage> std::allocate_shared[abi:se210105]<DB::StorageObjectStorage, std::allocator<DB::StorageObjectStorage>, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&, 0>(std::allocator<DB::StorageObjectStorage> const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&) @ 0x000000001f7185c7
2025.12.31 13:22:03.817671 [ 3728635 ] {} <Fatal> BaseDaemon: 10.0. inlined from contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:744: std::shared_ptr<DB::StorageObjectStorage> std::make_shared[abi:se210105]<DB::StorageObjectStorage, std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>, bool const&, bool, bool, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&, 0>(std::shared_ptr<DB::StorageObjectStorageConfiguration>&, std::shared_ptr<DB::IObjectStorage>&&, std::shared_ptr<DB::Context>&, DB::StorageID const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::optional<DB::FormatSettings>&, DB::LoadingStrictnessLevel const&, std::shared_ptr<DataLake::ICatalog>&&, bool const&, bool&&, bool&&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::IAST>&)
2025.12.31 13:22:03.817700 [ 3728635 ] {} <Fatal> BaseDaemon: 10. src/Storages/ObjectStorage/registerStorageObjectStorage.cpp:80: DB::(anonymous namespace)::createStorageObjectStorage(DB::StorageFactory::Arguments const&, std::shared_ptr<DB::StorageObjectStorageConfiguration>) @ 0x000000001f715768
2025.12.31 13:22:03.855434 [ 3728635 ] {} <Fatal> BaseDaemon: 11.0. inlined from src/Storages/ObjectStorage/registerStorageObjectStorage.cpp:372: operator()
2025.12.31 13:22:03.855483 [ 3728635 ] {} <Fatal> BaseDaemon: 11.1. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:87: std::__invoke_result_impl<void, DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&>::type std::__invoke[abi:se210105]<DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&>(DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&)
2025.12.31 13:22:03.855513 [ 3728635 ] {} <Fatal> BaseDaemon: 11.2. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:334: std::shared_ptr<DB::IStorage> std::__invoke_void_return_wrapper<std::shared_ptr<DB::IStorage>, false>::__call[abi:se210105]<DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&>(DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&)
2025.12.31 13:22:03.855542 [ 3728635 ] {} <Fatal> BaseDaemon: 11.3. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:348: std::shared_ptr<DB::IStorage> std::__invoke_r[abi:se210105]<std::shared_ptr<DB::IStorage>, DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&>(DB::registerStorageIceberg(DB::StorageFactory&)::$_4&, DB::StorageFactory::Arguments const&)
2025.12.31 13:22:03.855579 [ 3728635 ] {} <Fatal> BaseDaemon: 11. contrib/llvm-project/libcxx/include/__functional/function.h:450: ? @ 0x000000001f716f44
2025.12.31 13:22:03.862765 [ 3728635 ] {} <Fatal> BaseDaemon: 12.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:508: ?
2025.12.31 13:22:03.862794 [ 3728635 ] {} <Fatal> BaseDaemon: 12.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:772: ?
2025.12.31 13:22:03.862830 [ 3728635 ] {} <Fatal> BaseDaemon: 12. src/Storages/StorageFactory.cpp:228: DB::StorageFactory::get(DB::ASTCreateQuery const&, String const&, std::shared_ptr<DB::Context>, std::shared_ptr<DB::Context>, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, DB::LoadingStrictnessLevel, bool) const @ 0x000000001f3519c4
2025.12.31 13:22:03.912056 [ 3728635 ] {} <Fatal> BaseDaemon: 13. src/Interpreters/InterpreterCreateQuery.cpp:1964: DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&, std::unique_ptr<DB::DDLGuard, std::default_delete<DB::DDLGuard>>&, DB::LoadingStrictnessLevel) @ 0x000000001c64de09
2025.12.31 13:22:03.975216 [ 3728635 ] {} <Fatal> BaseDaemon: 14. src/Interpreters/InterpreterCreateQuery.cpp:1742: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x000000001c646bd0
2025.12.31 13:22:04.045690 [ 3728635 ] {} <Fatal> BaseDaemon: 15. src/Interpreters/InterpreterCreateQuery.cpp:2390: DB::InterpreterCreateQuery::execute() @ 0x000000001c6548f2
2025.12.31 13:22:04.089380 [ 3728635 ] {} <Fatal> BaseDaemon: 16. src/Interpreters/executeQuery.cpp:1731: 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>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::function<void ()>, DB::QueryResultDetails&) @ 0x000000001ca250e8
2025.12.31 13:22:04.140713 [ 3728635 ] {} <Fatal> BaseDaemon: 17. src/Interpreters/executeQuery.cpp:1955: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001ca1ead4
2025.12.31 13:22:04.173585 [ 3728635 ] {} <Fatal> BaseDaemon: 18. src/Server/TCPHandler.cpp:774: DB::TCPHandler::runImpl() @ 0x0000000020259189
2025.12.31 13:22:04.226497 [ 3728635 ] {} <Fatal> BaseDaemon: 19. src/Server/TCPHandler.cpp:2867: DB::TCPHandler::run() @ 0x00000000202741e4
2025.12.31 13:22:04.230396 [ 3728635 ] {} <Fatal> BaseDaemon: 20. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000266fe0ce
2025.12.31 13:22:04.234637 [ 3728635 ] {} <Fatal> BaseDaemon: 21. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000266fe73b
2025.12.31 13:22:04.238703 [ 3728635 ] {} <Fatal> BaseDaemon: 22. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000002669ec3f
2025.12.31 13:22:04.242782 [ 3728635 ] {} <Fatal> BaseDaemon: 23. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000002669c2cf
2025.12.31 13:22:04.242832 [ 3728635 ] {} <Fatal> BaseDaemon: 24. ? @ 0x00000000000a3d64
2025.12.31 13:22:04.242854 [ 3728635 ] {} <Fatal> BaseDaemon: 25. __GI___clone3 @ 0x00000000001373bc
2025.12.31 13:22:04.474455 [ 3728635 ] {} <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 62FD3F3BFC6730D20F050CB6DCD7CF98)

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasecomp-datalakeIssues related to iceberg, delta lake and all the catalog integrations.crashCrash / segfault / abortfuzzProblem found by one of the fuzzers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions