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

Race in 'SafelyOverflowingIndexQueue::pop' #118

Open
elBoberido opened this issue Feb 18, 2024 · 0 comments
Open

Race in 'SafelyOverflowingIndexQueue::pop' #118

elBoberido opened this issue Feb 18, 2024 · 0 comments
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:
Assuming the following scenario:

  • capacity is 1 (underlying buffer capacity is 2)
  • queue is full
  • pop loads write position
  • producer does an overflowing push
  • pop loads read position
  • read and write position are equal -> empty

Theoretically, this can happen for each pop operation if the push frequency is high enough. It can also happen for larger capacities but the probability is not as hight since the producer has to push more often within the window of the two load operations in pop

Expected result or behaviour:
The queue should detect the race and repeat the pop operation until it is successful if the queue is not empty.

Conditions where it occurred / Performed steps:
See Observed result or behaviour

@elBoberido elBoberido added the bug Something isn't working label Feb 18, 2024
@elBoberido elBoberido added this to the lock-free hardening milestone Feb 18, 2024
@elBoberido elBoberido self-assigned this Feb 18, 2024
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

No branches or pull requests

1 participant