Skip to content

Fix #780: rtic-sync panic #1030

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

Merged
merged 2 commits into from
Mar 12, 2025
Merged

Fix #780: rtic-sync panic #1030

merged 2 commits into from
Mar 12, 2025

Conversation

datdenkikniet
Copy link
Contributor

@datdenkikniet datdenkikniet commented Mar 12, 2025

An explicit PR that fixes the bug but sidesteps the addition of loom to avoid the side effects it may introduce.

Fixes #780

Extracts the relevant bugfix part from #1027

A description of the path leading to the bug, which also proves that the fix actually solves the problem:

  1. try_recv pushes into freeq.
  2. Before popping wait_queue, an interrupt occurs.
  3. send no. 1 eats up the freeq slot.
  4. send no. 2 is called, pushes its link to wait_queue and goes to sleep (because freeq is now empty)
  5. Control returns to try_recv, which pops wait_queue (from the newly waiting send call) without touching the free queue.
  6. send is awoken at some point. Its link is popped, but the freeq is empty.

@AfoHT AfoHT changed the title Fix #780 Fix #780: rtic-sync panic Mar 12, 2025
@korken89 korken89 added this pull request to the merge queue Mar 12, 2025
Merged via the queue into master with commit 1b8eb11 Mar 12, 2025
55 checks passed
@datdenkikniet datdenkikniet deleted the fix780 branch March 12, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion failed: !self.0.access(cs).freeq.is_empty() in rtic-sync 1.0.1 when trying to send data to channel
2 participants