-
Notifications
You must be signed in to change notification settings - Fork 36.9k
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
ci: tsan with -stdlib=libc++-10 #19041
Conversation
What does this change? Why? |
@sipa Looks like it extends tsan checks to include checks on Adding How about running both the clang-9 wallet+qt version and the clang-10 libc++? Or is there not meaningful threading to justify it? |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
e241ce7
to
cab0245
Compare
This fails because the suppressions can not be applied:
Anyone knows how to fix this? @practicalswift maybe? I already tried setting PATH to |
08052c2
to
fa1a893
Compare
Fixed all issues. Travis green on the tsan run. This is ready for review. The changes are split out into separate micro-commits, so should be easier to review. |
ACK faf62e6 Given the number of new suppressions I suggest also opening an issue for tackling them :) |
Concept ACK. Could removing I still not fully understand what is (potentially) wrong with code which emits "double locks" warnings about recursive mutexes. I can easy reproduce such warning but it does not give answers though. Could someone point me to resources to get knowledge? |
@hebasto Recursive mutexes are generally considered to be a bad idea. They work, and do what they're designed for - reentering a mutex you already hold is perfectly legal with them. However, they're generally a sign of badly structured code. In well-designed systems, you have code running inside the mutex, and code outside, and there is a clean barrier between the two. The fact that you need a recursive mutex means you have code that's trying to be useful in both, only making the boundary unclear. |
No, because the PATH is never passed into the ci container (docker) anyway and is therefore unset either way. |
I checked the first warning and it is about a plain mutex, not recursive one:
I suggest we simply accept the suppressions file for now and then work our way out of this by
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK faf62e6, maybe re-organize commits to modify suppressions in a single one?
I have a slight preference to keep it as is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested anything locally but commits all look ok. Can ACK once my comment has been addressed.
@@ -33,7 +33,9 @@ if [ -z "$NO_DEPENDS" ]; then | |||
else | |||
SHELL_OPTS="CONFIG_SHELL=" | |||
fi | |||
DOCKER_EXEC $SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS | |||
# Temporary workaround for https://github.com/bitcoin/bitcoin/issues/16368 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being muted because the depends build in the tsan job is now noisier when building with Clang and libstdc++? Or is this an unrelated commit similar to fac2eee?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a combination of all of the qt build issues I've been running into lately.
- Not sure how to pass in compiler flags to the qt build from outside to disable the wdeprecated warnings in depends. gui: Building with gcc 9 prints a trillion warnings (-Wdeprecated-copy) #15822
- Not sure if we can bump qt to a more recent version to get rid of the warnings QT abandoning open source LTS releases #18580
- Not sure how to solve depends: File-based logging for individual packages #16368
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just hoping that one of you build people will solve this one day 🙏 kthxbye
To limit the changes here to purely the ci folder, I will leave any build changes for the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, yes this commit is required. Otherwise the build log would exceed 40000 lines and be killed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to the qt build from outside to disable the wdeprecated warnings in depends.
Can you add NO_QT=1 NO_WALLET=1
to DEP_OPTS? Given qt is no-longer used here, and bdb wasn't used beforehand. If anything that should reduce the build output.
Not sure if we can bump qt to a more recent version
That's blocked until c++17, unless someone wants to fix c++11 support for a newer version (5.12) of Qt for macOS.
Regardless of above, I'll try follow up here and improve this for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add NO_QT=1 NO_WALLET=1 to DEP_OPTS? Given qt is no-longer used here, and bdb wasn't used beforehand. If anything that should reduce the build output.
Well the goal is to eventually enable tsan for the wallet and gui. I might wait for sqlite to avoid the bdb horror, but at least qt will be tested against hopefully soon.
Also, it is nice to have a test for the "can I compile qt depends with clang", even though the build result is thrown away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's blocked until c++17, unless someone wants to fix c++11 support for a newer version (5.12) of Qt for macOS.
Thanks, didn't know that they switched away from cxx11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, didn't know that they switched away from cxx11
heh. They didn't "officially". They just started using c++14 features in portions of the macOS code, while claiming to still support c++11. Some details in #17768.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK faf62e6
faf62e6 ci: Remove unused workaround (MarcoFalke) fa7c850 ci: Install llvm to get llvm symbolizer (MarcoFalke) fa563ce test: Add more tsan suppressions (MarcoFalke) fa0cc02 ci: Mute depends logs completely (MarcoFalke) fa906bf test: Extend tsan suppressions for clang stdlib (MarcoFalke) fa10d85 ci: Use libc++ instead of libstdc++ for tsan (MarcoFalke) fa0d5ee ci: Set halt_on_error=1 for tsan (MarcoFalke) fa2ffe8 ci: Deduplicate DOCKER_EXEC (MarcoFalke) fac2eee cirrus: Remove no longer needed install step (MarcoFalke) Pull request description: According to the [ThreadSanitizer docs](https://clang.llvm.org/docs/ThreadSanitizer.html#current-status): > C++11 threading is supported with **llvm libc++**. For example, the thread sanitizer build is currently not checking for double lock of mutexes. Fixes (partially) bitcoin#19038 (comment) ACKs for top commit: practicalswift: ACK faf62e6 fanquake: ACK faf62e6 hebasto: ACK faf62e6, maybe re-organize commits to modify suppressions in a single one? Tree-SHA512: 98ce5154b4736dfb811ffdb6e6f63a7bc25fe50d3b73134404a8f3715ad53626c31f9c8132dbacf85de47b9409f1e17a4399e35f78b1da30b1577167ea2982ad
Does this mean we should run CI test on Fedora as well? |
Summary: ~~ci: Remove unused workaround (MarcoFalke)~~ ~~ci: Install llvm to get llvm symbolizer (MarcoFalke)~~ test: Add more tsan suppressions (MarcoFalke) ~~ci: Mute depends logs completely (MarcoFalke)~~ test: Extend tsan suppressions for clang stdlib (MarcoFalke) ~~ci: Use libc++ instead of libstdc++ for tsan (MarcoFalke)~~ ~~ci: Set halt_on_error=1 for tsan (MarcoFalke)~~ ~~ci: Deduplicate DOCKER_EXEC (MarcoFalke)~~ ~~cirrus: Remove no longer needed install step (MarcoFalke)~~ Pull request description: According to the [ThreadSanitizer docs](https://clang.llvm.org/docs/ThreadSanitizer.html#current-status): > C++11 threading is supported with **llvm libc++**. For example, the thread sanitizer build is currently not checking for double lock of mutexes. Fixes (partially) bitcoin/bitcoin#19038 (comment) --- EDIT: included our own code's suppressions so the test is green Backport of Core [[bitcoin/bitcoin#19041 | PR19041]] Test Plan: with clang-10 on archlinux: cmake -GNinja -DENABLE_SANITIZERS=thread -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ninja check check-functional threadsanitizer is green ~~only gives out warnings about code that is exclusive to us (specifically, rcu_tests.cpp and doublelock of mutex in paymentserver qt code)~~ Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D7547
…ons by bumping to clang-12 fadea0b Revert "test: Add tsan supp for leveldb::DBImpl::DeleteObsoleteFiles" (MarcoFalke) fadbd99 test: Remove spurious double lock tsan suppressions by bumping to clang-12 (MarcoFalke) Pull request description: The double lock warnings appeared in bitcoin#19041, but they didn't make any sense. Also, our sync module would detect double locks, if there were any. Bumping to clang-12 allows us to remove the spurious suppressions needed to run the tests, so do that. ACKs for top commit: practicalswift: cr ACK fadea0b assuming CI passes and more specifically that newer Clang agrees that these TSan suppressions are no longer needed. Tree-SHA512: c411221a4b74d0af6ca8d686639b4f40b41c15906ccbb6647e8d569d6ab088264faafe075e1ac9523d5c0024b85f15a597bb3eedc7f07d4f5816245f75cfc08b
According to the ThreadSanitizer docs:
For example, the thread sanitizer build is currently not checking for double lock of mutexes.
Fixes (partially) #19038 (comment)