Description
Cargo is randomly entering an infinite loop in some rare cases. Noticed in CI:
- Polish code to clarify meaning #7836 (comment) — azure
- Rollup of 3 pull requests rust#68580 (comment) — azure
I've been able to reproduce it locally by putting Cargo's own test suite into a loop (while cargo test; do :; done
after about 30 minutes on my machine). It seems to randomly affect different tests. Attaching with a debugger, I see it caught in this loop, where dropping an mpsc receiver seems to be confused.
I strongly suspect this is caused by some change in #7731. Perhaps there is some odd interaction between crossbeam's scope() and mpsc? The only relevant change that I see is that DrainState
is now moved into the crossbeam scope, and thus dropped inside the scope, whereas previously the mpsc channels residing inside JobQueue
were dropped much later.
@Mark-Simulacrum Are you very familiar with mpsc or crossbeam's scope? mpsc seems wildly complex, and I don't know where to start trying to figure out what's wrong.
I might try removing FinishOnDrop
and see if I can repro again, as that seems a little fishy.