Skip to content

Fix multiple memory ordering/synchronization issues detected with Miri#72

Merged
faern merged 5 commits intomainfrom
fix-memory-orderings-with-miri
Jan 25, 2026
Merged

Fix multiple memory ordering/synchronization issues detected with Miri#72
faern merged 5 commits intomainfrom
fix-memory-orderings-with-miri

Conversation

@faern
Copy link
Copy Markdown
Owner

@faern faern commented Jan 24, 2026

Thanks to issue #69 which led to PR #71 I was able to track down some potential UB in oneshot due to too relaxed memory ordering in some places.

This PR makes all tests added in #71 pass except for:

  • tx_send_rx_poll_then_drop
  • tx_drop_rx_poll_then_drop

Those two tests are not caused by invalid memory orderings. Those tests fail because of #73 and will be fixed in a separate PR.

This PR fixes #69

@faern faern force-pushed the fix-memory-orderings-with-miri branch 2 times, most recently from c22a79e to 8150835 Compare January 25, 2026 15:11
faern added 5 commits January 25, 2026 16:27
Documents the safety requirements on the unsafe function regarding
synchronizing with the other end of the channel

Fixes the following miri tests:
tx_drop_rx_drop
tx_drop_rx_recv_ref
tx_drop_rx_recv_timeout
tx_drop_rx_try_recv_to_completion
tx_drop_rx_try_recv_then_drop
tx_drop_rx_poll_to_completion
Fixes the tx_drop_rx_recv_done test
@faern faern force-pushed the fix-memory-orderings-with-miri branch from 8150835 to b6fb012 Compare January 25, 2026 15:29
@faern faern merged commit ee1d1ac into main Jan 25, 2026
11 of 12 checks passed
@faern faern deleted the fix-memory-orderings-with-miri branch January 25, 2026 15:51
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.

Data race detected by Miri between Sender::take_waker() and Receiver::drop()

1 participant