rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.43k stars 629 forks source link

!Send Future fails Miri check #2877

Closed coder137 closed 3 months ago

coder137 commented 3 months ago

Similar to the tokio issue: https://github.com/tokio-rs/tokio/issues/6750 Swapped tokio::join! usage with futures::join! and was able to replicate the same issue

Description

Working on a TickedAsyncExecutor using smol's async_task where the futures only progress when the executor is ticked

The future test only fails when !Send future is used along with futures::join!

Replication

Passing case when Send future CI: https://github.com/coder137/ticked-async-executor/actions/runs/10259611867/job/28384360359 Branch: https://github.com/coder137/ticked-async-executor/tree/tokio_test Test: https://github.com/coder137/ticked-async-executor/blob/tokio_test/tests/futures_tests.rs

Failing case when !Send future CI: https://github.com/coder137/ticked-async-executor/actions/runs/10259553647/job/28384210470 Branch: https://github.com/coder137/ticked-async-executor/tree/tokio_test_spawn_local Test: https://github.com/coder137/ticked-async-executor/blob/tokio_test_spawn_local/tests/futures_tests.rs

Log info

= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information

ubuntu_futures_log.txt

taiki-e commented 3 months ago

This is not a problem of futures-rs. Closing in favor of an issue in Miri repo.