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

Data race due to operation reordering in 'spmc::UnrestrictedAtomic::load' #125

Closed
elBoberido opened this issue Feb 19, 2024 · 0 comments · Fixed by #126
Closed

Data race due to operation reordering in 'spmc::UnrestrictedAtomic::load' #125

elBoberido opened this issue Feb 19, 2024 · 0 comments · Fixed by #126
Assignees
Labels
bug Something isn't working

Comments

@elBoberido
Copy link
Member

Required information

Operating system:
all

Rust version:
all

Cargo version:
all

iceoryx2 version:
main branch

Observed result or behaviour:

Reading from data in load can lead to a data race due to a reordering with the check to determine whether the write position changed.

Expected result or behaviour:

No reordering happens.

Conditions where it occurred / Performed steps:

Data race in the CI. Hard to reproduce.

CI failure on aarch64

test spmc_unrestricted_atomic_load_store_works_concurrently ... FAILED
failures:
---- spmc_unrestricted_atomic_load_store_works_concurrently stdout ----
thread '<unnamed>' panicked at iceoryx2-bb/lock-free/tests/spmc_unrestricted_atomic_tests.rs:102:21:
assertion failed: expr: verify_no_data_race(&sut.load()) == true;  value: false == true
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'spmc_unrestricted_atomic_load_store_works_concurrently' panicked at iceoryx2-bb/lock-free/tests/spmc_unrestricted_atomic_tests.rs:96:5:
a scoped thread panicked
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
    spmc_unrestricted_atomic_load_store_works_concurrently
@elBoberido elBoberido added the bug Something isn't working label Feb 19, 2024
@elBoberido elBoberido added this to the lock-free hardening milestone Feb 19, 2024
@elBoberido elBoberido self-assigned this Feb 19, 2024
@elBoberido elBoberido changed the title Data race due operation reordering in 'spmc::UnrestrictedAtomic::load' Data race due to operation reordering in 'spmc::UnrestrictedAtomic::load' Feb 19, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 19, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 19, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 20, 2024
elBoberido added a commit that referenced this issue Feb 21, 2024
…-in-spmc-unrestricted-atomic

[#125] Fix reordering issue in 'spmc::UnrestrictedAtomic::load'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant