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

MPSC channel has data race #989

Closed
msimberg opened this issue Jan 22, 2024 · 0 comments · Fixed by #1209
Closed

MPSC channel has data race #989

msimberg opened this issue Jan 22, 2024 · 0 comments · Fixed by #1209
Assignees
Labels
effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: medium This should be done sooner or later. type: bug
Milestone

Comments

@msimberg
Copy link
Contributor

As reported by thread sanitizer (e.g. in channel_mpsc_shift test):

==================
WARNING: ThreadSanitizer: data race (pid=3631340)
  Read of size 4 at 0x7b04000028c0 by thread T1:
    #0 pika::experimental::base_channel_mpsc<int, pika::concurrency::detail::spinlock>::get(int*) const /home/mjs/src/pika/libs/pika/synchronization/include/pika/synchronization/channel_mpsc.hpp:112 (channel_mpsc_shift_test+0x10fbb9)
    #1 int channel_get<int>(pika::experimental::base_channel_mpsc<int, pika::concurrency::detail::spinlock> const&) /home/mjs/src/pika/libs/pika/synchronization/tests/unit/channel_mpsc_shift.cpp:30 (channel_mpsc_shift_test+0xfe596)
...

  Previous write of size 4 at 0x7b04000028c0 by thread T2:
    #0 pika::experimental::base_channel_mpsc<int, pika::concurrency::detail::spinlock>::set(int&&) /home/mjs/src/pika/libs/pika/synchronization/include/pika/synchronization/channel_mpsc.hpp:129 (channel_mpsc_shift_test+0x10f562)
    #1 void channel_set<int>(pika::experimental::base_channel_mpsc<int, pika::concurrency::detail::spinlock>&, int) /home/mjs/src/pika/libs/pika/synchronization/tests/unit/channel_mpsc_shift.cpp:37 (channel_mpsc_shift_test+0xfe518)
...

This will be suppressed in #972 for the moment. It may the cause of failures like these (on CircleCI arm64 CI configuration: https://app.circleci.com/pipelines/github/pika-org/pika/9926/workflows/7fd304f2-12e3-49fd-8dfa-59798de62a03/jobs/95968?invite=true#step-106-96082_145):

/home/circleci/project/pika/libs/pika/synchronization/tests/unit/channel_mpsc_fib.cpp(79): test 'fib == verify_fibonacci(i)' failed in function 'void consume_numbers(int, pika::experimental::channel_mpsc<bool> &, pika::experimental::channel_mpsc<int> &, pika::experimental::channel_mpsc<int> &)': '2 != 34'
Tests failed. 0/0 sanity checks and 1/24 tests failed.
@msimberg msimberg added effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: medium This should be done sooner or later. type: bug labels Jan 22, 2024
@msimberg msimberg added this to the 0.27.0 milestone Jul 30, 2024
@msimberg msimberg self-assigned this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: medium This should be done sooner or later. type: bug
Projects
Status: Archive
Development

Successfully merging a pull request may close this issue.

1 participant