Skip to content

Build with libcxx(abi) 15#42513

Merged
rschu1ze merged 12 commits intomasterfrom
update-libcxx-to-15
Oct 27, 2022
Merged

Build with libcxx(abi) 15#42513
rschu1ze merged 12 commits intomasterfrom
update-libcxx-to-15

Conversation

@rschu1ze
Copy link
Copy Markdown
Member

@rschu1ze rschu1ze commented Oct 19, 2022

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

This is a prerequisite for #42245

Multiple things happen in this PR:

@robot-clickhouse robot-clickhouse added pr-not-for-changelog This PR should not be mentioned in the changelog submodule changed At least one submodule changed in this PR. labels Oct 19, 2022
@devcrafter devcrafter self-assigned this Oct 20, 2022
@devcrafter devcrafter removed their assignment Oct 20, 2022
@rschu1ze rschu1ze force-pushed the update-libcxx-to-15 branch from 88fd21e to eda3955 Compare October 20, 2022 14:51
@rschu1ze
Copy link
Copy Markdown
Member Author

clickhouse-client --query "select 1" coredumps in fasttest. Hm, works nicely for me locally.

@rschu1ze
Copy link
Copy Markdown
Member Author

server.log:

2022.10.20 22:30:52.537137 [ 20411 ] {} <Fatal> BaseDaemon: Stack trace: 0xfa0a22f 0xfa03ef6 0xf972394 0xf97275f 0xb9582d6 0xb957926 0x10de455b 0x10de3981 0xb94706f 0x11043186 0xb93c2f0 0x110571b2 0xb9399a0 0x6fd47f1 0x7ff1ce4c2083 0x6fd3cae
2022.10.20 22:30:52.562551 [ 20411 ] {} <Fatal> BaseDaemon: 3.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/atomic:958: bool std::__1::__cxx_atomic_load[abi:v15003]<bool>(std::__1::__cxx_atomic_base_impl<bool> const*, std::__1::memory_order)
2022.10.20 22:30:52.562598 [ 20411 ] {} <Fatal> BaseDaemon: 3.2. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/atomic:1560: std::__1::__atomic_base<bool, false>::load[abi:v15003](std::__1::memory_order) const
2022.10.20 22:30:52.562602 [ 20411 ] {} <Fatal> BaseDaemon: 3.3. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/atomic:1564: std::__1::__atomic_base<bool, false>::operator bool[abi:v15003]() const
2022.10.20 22:30:52.562607 [ 20411 ] {} <Fatal> BaseDaemon: 3.4. inlined from /fasttest-workspace/build/../../ClickHouse/src/Common/ThreadPool.h:228: ~ThreadFromGlobalPoolImpl
2022.10.20 22:30:52.562610 [ 20411 ] {} <Fatal> BaseDaemon: 3. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/ExternalLoader.cpp:1235: DB::ExternalLoader::PeriodicUpdater::enable(bool) @ 0xfa0a22f in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.569182 [ 20411 ] {} <Fatal> BaseDaemon: 4.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/__memory/shared_ptr.h:1508: weak_ptr<const DB::Context>
2022.10.20 22:30:52.569207 [ 20411 ] {} <Fatal> BaseDaemon: 4. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/ExternalDictionariesLoader.cpp:26: DB::ExternalDictionariesLoader::ExternalDictionariesLoader(std::__1::shared_ptr<DB::Context const>) @ 0xfa03ef6 in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.641362 [ 20411 ] {} <Fatal> BaseDaemon: 5. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/Context.cpp:1552: DB::Context::getExternalDictionariesLoaderUnlocked() @ 0xf972394 in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.711380 [ 20411 ] {} <Fatal> BaseDaemon: 6. /fasttest-workspace/build/../../ClickHouse/src/Interpreters/Context.cpp:0: DB::Context::loadOrReloadDictionaries(Poco::Util::AbstractConfiguration const&) @ 0xf97275f in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.756343 [ 20411 ] {} <Fatal> BaseDaemon: 7.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/poco/Foundation/include/Poco/AutoPtr.h:231: Poco::AutoPtr<Poco::Util::AbstractConfiguration>::operator*()
2022.10.20 22:30:52.756377 [ 20411 ] {} <Fatal> BaseDaemon: 7. /fasttest-workspace/build/../../ClickHouse/programs/server/Server.cpp:1170: DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4::operator()(Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool) const @ 0xb9582d6 in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.801080 [ 20411 ] {} <Fatal> BaseDaemon: 8.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/poco/Foundation/include/Poco/AutoPtr.h:90: ~AutoPtr
2022.10.20 22:30:52.801119 [ 20411 ] {} <Fatal> BaseDaemon: 8.2. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/__functional/invoke.h:394: decltype(std::declval<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4&>()(std::declval<Poco::AutoPtr<Poco::Util::AbstractConfiguration>>(), std::declval<bool>())) std::__1::__invoke[abi:v15003]<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>(DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&)
2022.10.20 22:30:52.801146 [ 20411 ] {} <Fatal> BaseDaemon: 8.3. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/__functional/invoke.h:479: void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>(DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&)
2022.10.20 22:30:52.801157 [ 20411 ] {} <Fatal> BaseDaemon: 8.4. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/__functional/function.h:235: std::__1::__function::__default_alloc_func<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4, void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>::operator()[abi:v15003](Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&)
2022.10.20 22:30:52.801160 [ 20411 ] {} <Fatal> BaseDaemon: 8. /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/__functional/function.h:716: void std::__1::__function::__policy_invoker<void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>::__call_impl<std::__1::__function::__default_alloc_func<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_4, void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>>(std::__1::__function::__policy_storage const*, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool) @ 0xb957926 in /fasttest-workspace/build/programs/clickhouse
2022.10.20 22:30:52.809578 [ 20411 ] {} <Fatal> BaseDaemon: 9.1. inlined from /fasttest-workspace/build/../../ClickHouse/contrib/poco/Foundation/include/Poco/AutoPtr.h:90: ~AutoPtr

I have seen this error also in other PRs.

extern const int CORRUPTED_DATA;
}

SummingSortedAlgorithm::ColumnsDefinition::ColumnsDefinition() = default;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColumnsDefinition contains a std::vector<AggregateDescription> member. The vector destructor std::~vector() (called in ColumnsDefinition::~ColumnsDefinition()) does some bookkeeping which requires to know the full definition of AggregateDescription. To make this work, the three defaulted functions are here moved behind the definition of `AggregateDescription'. So I think the change makes sense in general.

The question remains why it used to work before. I see that they made a lot of methods of std::vector in libcxx15 constexpr, including the vector destructor. However, that would only be an explanation if ColumnsDefinition is used in a compile-time/constexpr context but this is not done here. Besides that and nothing else changed in std::vector, I don't really have a good explanation :-/

@devcrafter devcrafter self-assigned this Oct 25, 2022
@rschu1ze
Copy link
Copy Markdown
Member Author

I think this PR is ready-to-merge. Does anyone like to approve? Thanks!

Copy link
Copy Markdown
Member

@devcrafter devcrafter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rschu1ze rschu1ze merged commit 31ef6c6 into master Oct 27, 2022
@rschu1ze rschu1ze deleted the update-libcxx-to-15 branch October 27, 2022 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants