Open nazar-pc opened 3 weeks ago
Maybe related: https://github.com/rust-lang/futures-rs/issues/2781
Pushed another commit into above branch with a lot of code and dependencies removed, while still reproducing an issue.
There are 2 FuturesUnordered
usages there in redials
and inbound_requests
, having just one of them no longer triggers an issue for some reason.
Also if replacing result_receiver.await.map_err(|_| ())
with this:
result_receiver.await.unwrap();
Ok(())
Then I'm getting following interesting error:
thread 'tests::basic' panicked at library/core/src/panicking.rs:223:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
Which might be of interest as well.
Originally reported as https://github.com/tokio-rs/tokio/issues/6452, but I think this might be a
futures
problem actually.I created a (non-minimal unfortunately) reproduction branch where last commit is showing an issue: https://github.com/subspace/subspace/tree/futures-malloc_consolidate-reproduction
On Linux it looks like this:
Here is a backtrace I collected originally:
The change in last commit is actually incorrect and causes panic, specifically this code is not allowed to block in single-threaded tokio runtime:
I expected to see a panic, but getting memory issues instead.
As shown in https://github.com/tokio-rs/tokio/issues/6452#issuecomment-2031837214 the likely cause is
futures
crate,FuturesUnordered
to be specific.