-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add address, undefined behaviour, and thread sanitizer CI configurations #972
Conversation
fe31f80
to
70e2391
Compare
dc73d2e
to
325c0b0
Compare
I'm going to ignore memory sanitizer in this PR, because it requires recompiling everything with |
e2c1050
to
92e4d93
Compare
1a4455d
to
0cc5f2e
Compare
0cc5f2e
to
aa83635
Compare
aa83635
to
fd2dfd9
Compare
cscs-ci run |
fd2dfd9
to
4bcf07a
Compare
cscs-ci run |
c5d5661
to
80822bb
Compare
cscs-ci run |
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.
LGTM thanks a lot!
It appears that thread sanitizer is not safe to use with stacks that migrate between os threads. See https://groups.google.com/g/boost-developers-archive/c/xNNhBnfhANA and https://stackoverflow.com/questions/73358829/segfault-in-tsan-in-boost-ci-need-the-help-of-an-expert for a case reported in Boost asio/beast. Stacktraces in pika tend to look like the following when stealing is enabled: ``` )(pika::latch&), pika::util::detail::pack_c<unsigned long, 0ul>, std::reference_wrapper<pika::latch> > >::then_sender_type, std::allocator<int> >::ensure_started_sender_type::shared_state::set_predecessor_done (this=0x7b280000a640) at /home/mjs/src/pika/libs/pika/execution /include/pika/execution/algorithms/ensure_started.hpp:26 ``` Note, stealing of staged threads (thread descriptions) is not disabled, as they haven't allocated or used a stack yet.
…t with address sanitizer
80822bb
to
83abc5c
Compare
cscs-ci run |
Adds two new CI pipelines with sanitizers:
The existing sanitizer CI configurations are unchanged.
The address sanitizer setup seems to pass for all tests, with some suppressions.
detect_stack_use_after_return
seems problematic so it's currently disabled (#992). Additionally, thetask_overhead_report
seems to trigger very high memory usage with address sanitizer.detect_stack_use_after_return
may be triggering similar problems in other tests. A potential use-after-scope has been suppressed for now inbind
(#993).For thread sanitizer I've suppressed data races coming from various lockfree queues (#990), the MPSC queue (#989). I've also disabled stealing of pending threads on the
local_*
schedulers as thread sanitizer seems to dislike stacks migrating across OS threads (see 6a5b074 for more details).In the interest of getting what works into main I'm going to go ahead with the current state of this PR without making the two new CI configurations required checks. The two already existing sanitizer CI configurations remain required checks. I'm going to continue working on the remaining failures in follow-up PRs.