Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to libcxx / libcxxabi from LLVM 14 #34906

Merged
merged 9 commits into from
Mar 26, 2022

Conversation

Algunenano
Copy link
Member

@Algunenano Algunenano commented Feb 25, 2022

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Switch to libcxx / libcxxabi from LLVM 14.

Information about CI checks: https://clickhouse.tech/docs/en/development/continuous-integration/

  • Minor changes to hyperscan to make it compatible.
  • Does not update contrib/llvm (for the embedded compiler and cross build?).

Related to #34754
Closes #32018

@robot-clickhouse robot-clickhouse added the pr-build Pull request with build/testing/packaging improvement label Feb 25, 2022
@Algunenano
Copy link
Member Author

This seems to be hitting some issue with the filesystems.

Example triggering some issues:

./tests/clickhouse-test 00836_indices_alter.sql --test-runs 100 -j10

After a few runs:

00836_indices_alter:                                                    [ OK ]
00836_indices_alter:                                                    [ FAIL ] - return code: 61
[Mordor] 2022.02.25 16:04:40.584594 [ 440228 ] {219f8499-e653-4692-85c9-dace928fbeba} <Error> executeQuery: Code: 573. DB::ErrnoException: Cannot add new descriptor to epoll, errno: 22, strerror: Invalid argument. (EPOLL_ERROR) (version 22.3.1.1) (from [::1]:56846) (comment: 00836_indices_alter.sql) (in query: INSERT INTO minmax_idx VALUES ), Stack trace (when copying this message, always include the lines below):

0. ./build_msan/./contrib/libcxx/include/exception:0: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x4b876027 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
1. ./build_msan/./src/Common/Exception.cpp:58: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xb4c7db9 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
2. ./build_msan/./src/Common/Exception.h:93: DB::ErrnoException::ErrnoException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) @ 0xb4dba9e in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
3. ./build_msan/./src/Common/Exception.cpp:0: DB::throwFromErrno(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int) @ 0xb4cc065 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
4. ./build_msan/./src/Common/Epoll.cpp:0: DB::Epoll::add(int, void*) @ 0x3a826703 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
5. ./build_msan/./src/Processors/Executors/PollingQueue.cpp:0: DB::PollingQueue::PollingQueue() @ 0x407ee840 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
6. ./build_msan/./src/Processors/Executors/ExecutorTasks.h:35: DB::PipelineExecutor::PipelineExecutor(std::__1::vector<std::__1::shared_ptr<DB::IProcessor>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >&, DB::QueryStatus*) @ 0x407b24a7 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
7. ./build_msan/./contrib/libcxx/include/__memory/allocation_guard.h:66: std::__1::shared_ptr<DB::PipelineExecutor> std::__1::make_shared<DB::PipelineExecutor, std::__1::vector<std::__1::shared_ptr<DB::IProcessor>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >&, DB::QueryStatus*&, void>(std::__1::vector<std::__1::shared_ptr<DB::IProcessor>, std::__1::allocator<std::__1::shared_ptr<DB::IProcessor> > >&, DB::QueryStatus*&) @ 0x3a7ccdcc in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
8. ./build_msan/./src/Processors/Executors/PushingPipelineExecutor.cpp:0: DB::PushingPipelineExecutor::start() @ 0x4080ab1b in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
9. ./build_msan/./src/Server/TCPHandler.cpp:0: DB::TCPHandler::processInsertQuery() @ 0x406557f4 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
10. ./build_msan/./src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x4063ef48 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
11. ./build_msan/./src/Server/TCPHandler.cpp:0: DB::TCPHandler::run() @ 0x406871f9 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
12. ./build_msan/./contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x4b30ca9c in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
13. ./build_msan/./contrib/libcxx/include/__memory/unique_ptr.h:312: Poco::Net::TCPServerDispatcher::run() @ 0x4b30df1c in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
14. ./build_msan/./contrib/poco/Foundation/src/ThreadPool.cpp:0: Poco::PooledThread::run() @ 0x4ba3b1c4 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
15. ./build_msan/./contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x4ba36440 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
16. ./build_msan/./contrib/poco/Foundation/include/Poco/SharedPtr.h:277: Poco::ThreadImpl::runnableEntry(void*) @ 0x4ba32101 in /mnt/ch/ClickHouse/build_msan/programs/clickhouse
17. ? @ 0x7f97ba7ea5c2 in ?
18. clone @ 0x7f97ba86f584 in ?

Need to find out if this is an existing bug that's uncovered / made worse by the update, or an issue introduced by the update itself.

@Algunenano
Copy link
Member Author

Updating llvm-14 branch to bring a Fix double file closing in std::filesystem::remove_all() from https://reviews.llvm.org/D120453. This seems to fix the obvious failing tests locally.

@Algunenano
Copy link
Member Author

As mentioned in #34681 (comment) by @danlark1 Hyperscan has some issues with C++20. Adding a temporal fork to confirm the issue (it fixes it locally).

Checked with one of the queries of the failed test:

Select multiFuzzyMatchAny('leftabcright', 1, ['a1c']);

Master: 1. After updating libcxx and libcxxabi to LLVM 14: 0 (unexpected). After the patch to hyperscan: 1

@Algunenano
Copy link
Member Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 2, 2022

update

✅ Branch has been successfully updated

@Algunenano
Copy link
Member Author

This is pretty much done but I'm waiting for LLVM to do a final release, since I'd rather have the final commit and not an RC version in the submodule.

@Algunenano
Copy link
Member Author

Rebasing the PR with master and updating the libraries to llvmorg-14.0.0. There are just minor changes that shouldn't matter (internal cmake stuff), so once it's green I'll create the PRs to update the 3 libraries (libcxx, libcxx-abi and hyperscan)

@Algunenano
Copy link
Member Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2022

update

✅ Branch has been successfully updated

@Algunenano
Copy link
Member Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2022

update

✅ Branch has been successfully updated

@Algunenano
Copy link
Member Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2022

update

✅ Branch has been successfully updated

@Algunenano
Copy link
Member Author

Created the 3 prs:

Once merged, I can stop using my submodules and this can move forward.

@alexey-milovidov
Copy link
Member

@Algunenano Repositories for submodules are updated.

@alexey-milovidov alexey-milovidov self-assigned this Mar 26, 2022
@Algunenano
Copy link
Member Author

Thanks a lot. I've removed my forks from the submodules and updated them.

@Algunenano Algunenano changed the title Draft: Switch to libcxx / libcxxabi from LLVM 14 Switch to libcxx / libcxxabi from LLVM 14 Mar 26, 2022
@alexey-milovidov alexey-milovidov merged commit 619e11b into ClickHouse:master Mar 26, 2022
azat added a commit to azat/ClickHouse that referenced this pull request Mar 27, 2022
Fixes: ClickHouse#34906
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat azat mentioned this pull request Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-build Pull request with build/testing/packaging improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libcxx 13 compatibility
3 participants